From 7320be4d5903456aedaba8ec026ef8ec1e58e41b Mon Sep 17 00:00:00 2001 From: Plancke Date: Sat, 4 Aug 2018 18:03:58 -0400 Subject: [PATCH] megawalls resource and level changes (reclaim update) --- README.md | 2 +- resources/game_info/Walls3.php | 85 ++++++++++++++++++++++++++++--- resources/game_info/walls3.json | 85 +++++++++++++++++++++++++++---- src/util/GameUtils.php | 47 ----------------- src/util/games/BedwarsUtils.php | 47 +++++++++++++++++ src/util/games/GameUtils.php | 42 +++++++++++++++ src/util/games/MegaWallsUtils.php | 35 +++++++++++++ 7 files changed, 277 insertions(+), 66 deletions(-) delete mode 100644 src/util/GameUtils.php create mode 100644 src/util/games/BedwarsUtils.php create mode 100644 src/util/games/GameUtils.php create mode 100644 src/util/games/MegaWallsUtils.php diff --git a/README.md b/README.md index f1681f0..778e1be 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The preferred method of installing this library is with [Composer](https://getcomposer.org) by running the following from your project root: - $ composer require "plancke/hypixel-php=^1.0.9" + $ composer require "plancke/hypixel-php=^1.0.10" If you plan on using the mongo cache implementation you'll also need to require mongo, (suggested package) diff --git a/resources/game_info/Walls3.php b/resources/game_info/Walls3.php index 0d90eec..f1c49f1 100644 --- a/resources/game_info/Walls3.php +++ b/resources/game_info/Walls3.php @@ -6,6 +6,7 @@ array( 'HUNTER' => array( + 'id' => 'HUNTER', 'display' => 'Hunter', 'description' => 'Use superior archery skills to pelt enemies with arrows.', 'type' => 'HERO', @@ -18,6 +19,7 @@ ), 'ZOMBIE' => array( + 'id' => 'ZOMBIE', 'display' => 'Zombie', 'description' => 'The Zombie class focuses on defensive gameplay and healing.', 'type' => 'NORMAL', @@ -27,9 +29,11 @@ 1 => 'SUPPORT', ), 'difficulty' => 2, + 'starter' => true, ), 'CREEPER' => array( + 'id' => 'CREEPER', 'display' => 'Creeper', 'description' => 'The Creeper class uses explosion based powers to win.', 'type' => 'NORMAL', @@ -42,6 +46,7 @@ ), 'ARCANIST' => array( + 'id' => 'ARCANIST', 'display' => 'Arcanist', 'description' => 'PLACEHOLDER', 'type' => 'HERO', @@ -54,6 +59,7 @@ ), 'SHAMAN' => array( + 'id' => 'SHAMAN', 'display' => 'Shaman', 'description' => 'PLACEHOLDER', 'type' => 'HERO', @@ -66,6 +72,7 @@ ), 'DREADLORD' => array( + 'id' => 'DREADLORD', 'display' => 'Dreadlord', 'description' => 'PLACEHOLDER', 'type' => 'HERO', @@ -78,6 +85,7 @@ ), 'GOLEM' => array( + 'id' => 'GOLEM', 'display' => 'Golem', 'description' => 'PLACEHOLDER', 'type' => 'HERO', @@ -90,6 +98,7 @@ ), 'SQUID' => array( + 'id' => 'SQUID', 'display' => 'Squid', 'description' => 'Splashing around, like a Squid, because thats what Squids do. Splash.', 'type' => 'NORMAL', @@ -102,6 +111,7 @@ ), 'MOLEMAN' => array( + 'id' => 'MOLEMAN', 'display' => 'Moleman', 'description' => 'Wanna play wacka mole...?', 'type' => 'MYTHIC', @@ -114,6 +124,7 @@ ), 'ENDERMAN' => array( + 'id' => 'ENDERMAN', 'display' => 'Enderman', 'description' => 'The Enderman class has special teleportation powers and endurance.', 'type' => 'NORMAL', @@ -123,9 +134,11 @@ 1 => 'RUSHER', ), 'difficulty' => 2, + 'starter' => true, ), 'HEROBRINE' => array( + 'id' => 'HEROBRINE', 'display' => 'Herobrine', 'description' => 'The Herobrine class uses supernatural abilities to attack and destroy your enemies.', 'type' => 'NORMAL', @@ -135,9 +148,11 @@ 1 => 'DAMAGE', ), 'difficulty' => 1, + 'starter' => true, ), 'BLAZE' => array( + 'id' => 'BLAZE', 'display' => 'Blaze', 'description' => 'The Blaze class uses the spirit of fire to enfore flames.', 'type' => 'HERO', @@ -150,6 +165,7 @@ ), 'PIGMAN' => array( + 'id' => 'PIGMAN', 'display' => 'Pigman', 'description' => 'Half man, half pig, half..oh wait! Feel the power of pork!', 'type' => 'HERO', @@ -162,6 +178,7 @@ ), 'SPIDER' => array( + 'id' => 'SPIDER', 'display' => 'Spider', 'description' => 'The Spider class uses agile paths for combat.', 'type' => 'NORMAL', @@ -174,6 +191,7 @@ ), 'WEREWOLF' => array( + 'id' => 'WEREWOLF', 'display' => 'Werewolf', 'description' => 'It\'s always full moon for this brawler.. Slice and dice your way to victory!', 'type' => 'MYTHIC', @@ -186,6 +204,7 @@ ), 'PIRATE' => array( + 'id' => 'PIRATE', 'display' => 'Pirate', 'description' => 'Use cunning and wit to survive, or blow enemies up with parrots.', 'type' => 'HERO', @@ -198,6 +217,7 @@ ), 'PHOENIX' => array( + 'id' => 'PHOENIX', 'display' => 'Phoenix', 'description' => 'Born from the ashes of my predecessor I shall erase you from existence!', 'type' => 'MYTHIC', @@ -210,6 +230,7 @@ ), 'SKELETON' => array( + 'id' => 'SKELETON', 'display' => 'Skeleton', 'description' => 'The Skeleton class makes excellent use of ranged abilities and weapons.', 'type' => 'NORMAL', @@ -219,9 +240,11 @@ 1 => 'MOBILITY', ), 'difficulty' => 3, + 'starter' => true, ), 'ASSASSIN' => array( + 'id' => 'ASSASSIN', 'display' => 'Assassin', 'description' => '', 'type' => 'MYTHIC', @@ -234,6 +257,7 @@ ), 'RENEGADE' => array( + 'id' => 'RENEGADE', 'display' => 'Renegade', 'description' => '', 'type' => 'MYTHIC', @@ -246,6 +270,7 @@ ), 'SNOWMAN' => array( + 'id' => 'SNOWMAN', 'display' => 'Snowman', 'description' => '', 'type' => 'MYTHIC', @@ -258,6 +283,7 @@ ), 'AUTOMATON' => array( + 'id' => 'AUTOMATON', 'display' => 'Automaton', 'description' => '', 'type' => 'MYTHIC', @@ -270,6 +296,7 @@ ), 'COW' => array( + 'id' => 'COW', 'display' => 'Cow', 'description' => '', 'type' => 'NORMAL', @@ -282,6 +309,7 @@ ), 'SHARK' => array( + 'id' => 'SHARK', 'display' => 'Shark', 'description' => '', 'type' => 'NORMAL', @@ -293,15 +321,58 @@ 'difficulty' => 1, ), ), + 'skills' => + array( + 'SKILL' => + array( + 'id' => 'SKILL', + 'field' => 'classes.%class%.skill_level_a', + 'cleanName' => 'Skill', + 'maxLevel' => 5, + ), + 'PASSIVE_1' => + array( + 'id' => 'PASSIVE_1', + 'field' => 'classes.%class%.skill_level_b', + 'cleanName' => 'Passive 1', + 'maxLevel' => 3, + ), + 'PASSIVE_2' => + array( + 'id' => 'PASSIVE_2', + 'field' => 'classes.%class%.skill_level_c', + 'cleanName' => 'Passive 2', + 'maxLevel' => 3, + ), + 'GATHERING' => + array( + 'id' => 'GATHERING', + 'field' => 'classes.%class%.skill_level_g', + 'cleanName' => 'Gathering', + 'maxLevel' => 3, + ), + 'KIT' => + array( + 'id' => 'KIT', + 'field' => 'classes.%class%.skill_level_d', + 'cleanName' => 'Kit', + 'maxLevel' => 5, + ), + ), 'fields' => array( - 'Skill' => 'classes.%class%.skill_level_a', - 'Passive 1' => 'classes.%class%.skill_level_b', - 'Passive 2' => 'classes.%class%.skill_level_c', - 'Kit' => 'classes.%class%.skill_level_d', - 'Gathering' => 'classes.%class%.skill_level_g', - 'Prestige' => 'classes.%class%.prestige', - 'Enderchest' => 'classes.%class%.enderchest_rows', + 'PRESTIGE' => + array( + 'id' => 'PRESTIGE', + 'field' => 'classes.%class%.prestige', + 'cleanName' => 'Prestige', + ), + 'ENDERCHEST' => + array( + 'id' => 'PRESTIGE', + 'field' => 'classes.%class%.prestige', + 'cleanName' => 'Prestige', + ), ), ), 'modes' => diff --git a/resources/game_info/walls3.json b/resources/game_info/walls3.json index 73d24f0..0fab7bd 100644 --- a/resources/game_info/walls3.json +++ b/resources/game_info/walls3.json @@ -2,6 +2,7 @@ "classes": { "list": { "HUNTER": { + "id": "HUNTER", "display": "Hunter", "description": "Use superior archery skills to pelt enemies with arrows.", "type": "HERO", @@ -12,6 +13,7 @@ "difficulty": 3.0 }, "ZOMBIE": { + "id": "ZOMBIE", "display": "Zombie", "description": "The Zombie class focuses on defensive gameplay and healing.", "type": "NORMAL", @@ -19,9 +21,11 @@ "TANK", "SUPPORT" ], - "difficulty": 2.0 + "difficulty": 2.0, + "starter": true }, "CREEPER": { + "id": "CREEPER", "display": "Creeper", "description": "The Creeper class uses explosion based powers to win.", "type": "NORMAL", @@ -32,6 +36,7 @@ "difficulty": 4.0 }, "ARCANIST": { + "id": "ARCANIST", "display": "Arcanist", "description": "PLACEHOLDER", "type": "HERO", @@ -42,6 +47,7 @@ "difficulty": 1.0 }, "SHAMAN": { + "id": "SHAMAN", "display": "Shaman", "description": "PLACEHOLDER", "type": "HERO", @@ -52,6 +58,7 @@ "difficulty": 3.0 }, "DREADLORD": { + "id": "DREADLORD", "display": "Dreadlord", "description": "PLACEHOLDER", "type": "HERO", @@ -62,6 +69,7 @@ "difficulty": 1.0 }, "GOLEM": { + "id": "GOLEM", "display": "Golem", "description": "PLACEHOLDER", "type": "HERO", @@ -72,6 +80,7 @@ "difficulty": 2.0 }, "SQUID": { + "id": "SQUID", "display": "Squid", "description": "Splashing around, like a Squid, because thats what Squids do. Splash.", "type": "NORMAL", @@ -82,6 +91,7 @@ "difficulty": 1.0 }, "MOLEMAN": { + "id": "MOLEMAN", "display": "Moleman", "description": "Wanna play wacka mole...?", "type": "MYTHIC", @@ -92,6 +102,7 @@ "difficulty": 2.0 }, "ENDERMAN": { + "id": "ENDERMAN", "display": "Enderman", "description": "The Enderman class has special teleportation powers and endurance.", "type": "NORMAL", @@ -99,9 +110,11 @@ "MOBILITY", "RUSHER" ], - "difficulty": 2.0 + "difficulty": 2.0, + "starter": true }, "HEROBRINE": { + "id": "HEROBRINE", "display": "Herobrine", "description": "The Herobrine class uses supernatural abilities to attack and destroy your enemies.", "type": "NORMAL", @@ -109,9 +122,11 @@ "FIGHTER", "DAMAGE" ], - "difficulty": 1.0 + "difficulty": 1.0, + "starter": true }, "BLAZE": { + "id": "BLAZE", "display": "Blaze", "description": "The Blaze class uses the spirit of fire to enfore flames.", "type": "HERO", @@ -122,6 +137,7 @@ "difficulty": 2.0 }, "PIGMAN": { + "id": "PIGMAN", "display": "Pigman", "description": "Half man, half pig, half..oh wait! Feel the power of pork!", "type": "HERO", @@ -132,6 +148,7 @@ "difficulty": 2.0 }, "SPIDER": { + "id": "SPIDER", "display": "Spider", "description": "The Spider class uses agile paths for combat.", "type": "NORMAL", @@ -142,6 +159,7 @@ "difficulty": 3.0 }, "WEREWOLF": { + "id": "WEREWOLF", "display": "Werewolf", "description": "It's always full moon for this brawler.. Slice and dice your way to victory!", "type": "MYTHIC", @@ -152,6 +170,7 @@ "difficulty": 2.0 }, "PIRATE": { + "id": "PIRATE", "display": "Pirate", "description": "Use cunning and wit to survive, or blow enemies up with parrots.", "type": "HERO", @@ -162,6 +181,7 @@ "difficulty": 3.0 }, "PHOENIX": { + "id": "PHOENIX", "display": "Phoenix", "description": "Born from the ashes of my predecessor I shall erase you from existence!", "type": "MYTHIC", @@ -172,6 +192,7 @@ "difficulty": 4.0 }, "SKELETON": { + "id": "SKELETON", "display": "Skeleton", "description": "The Skeleton class makes excellent use of ranged abilities and weapons.", "type": "NORMAL", @@ -179,9 +200,11 @@ "RANGED", "MOBILITY" ], - "difficulty": 3.0 + "difficulty": 3.0, + "starter": true }, "ASSASSIN": { + "id": "ASSASSIN", "display": "Assassin", "description": "", "type": "MYTHIC", @@ -192,6 +215,7 @@ "difficulty": 2.0 }, "RENEGADE": { + "id": "RENEGADE", "display": "Renegade", "description": "", "type": "MYTHIC", @@ -202,6 +226,7 @@ "difficulty": 3.0 }, "SNOWMAN": { + "id": "SNOWMAN", "display": "Snowman", "description": "", "type": "MYTHIC", @@ -212,6 +237,7 @@ "difficulty": 3.0 }, "AUTOMATON": { + "id": "AUTOMATON", "display": "Automaton", "description": "", "type": "MYTHIC", @@ -222,6 +248,7 @@ "difficulty": 4.0 }, "COW": { + "id": "COW", "display": "Cow", "description": "", "type": "NORMAL", @@ -232,6 +259,7 @@ "difficulty": 2.0 }, "SHARK": { + "id": "SHARK", "display": "Shark", "description": "", "type": "NORMAL", @@ -242,14 +270,49 @@ "difficulty": 1.0 } }, + "skills": { + "SKILL": { + "id": "SKILL", + "field": "classes.%class%.skill_level_a", + "cleanName": "Skill", + "maxLevel": 5 + }, + "PASSIVE_1": { + "id": "PASSIVE_1", + "field": "classes.%class%.skill_level_b", + "cleanName": "Passive 1", + "maxLevel": 3 + }, + "PASSIVE_2": { + "id": "PASSIVE_2", + "field": "classes.%class%.skill_level_c", + "cleanName": "Passive 2", + "maxLevel": 3 + }, + "GATHERING": { + "id": "GATHERING", + "field": "classes.%class%.skill_level_g", + "cleanName": "Gathering", + "maxLevel": 3 + }, + "KIT": { + "id": "KIT", + "field": "classes.%class%.skill_level_d", + "cleanName": "Kit", + "maxLevel": 5 + } + }, "fields": { - "Skill": "classes.%class%.skill_level_a", - "Passive 1": "classes.%class%.skill_level_b", - "Passive 2": "classes.%class%.skill_level_c", - "Kit": "classes.%class%.skill_level_d", - "Gathering": "classes.%class%.skill_level_g", - "Prestige": "classes.%class%.prestige", - "Enderchest": "classes.%class%.enderchest_rows" + "PRESTIGE": { + "id": "PRESTIGE", + "field": "classes.%class%.prestige", + "cleanName": "Prestige" + }, + "ENDERCHEST": { + "id": "PRESTIGE", + "field": "classes.%class%.prestige", + "cleanName": "Prestige" + } } }, "modes": { diff --git a/src/util/GameUtils.php b/src/util/GameUtils.php deleted file mode 100644 index ceff743..0000000 --- a/src/util/GameUtils.php +++ /dev/null @@ -1,47 +0,0 @@ - 5) { - $over = $prestige % 5; - $exp += $over * GameUtils::BEDWARS_EXP_PER_PRESTIGE; - $prestige -= $over; - } - - // first few levels are different - if ($exp < 500) { - return 0 + ($prestige * GameUtils::BEDWARS_LEVELS_PER_PRESTIGE); - } else if ($exp < 1500) { - return 1 + ($prestige * GameUtils::BEDWARS_LEVELS_PER_PRESTIGE); - } else if ($exp < 3500) { - return 2 + ($prestige * GameUtils::BEDWARS_LEVELS_PER_PRESTIGE); - } else if ($exp < 5500) { - return 3 + ($prestige * GameUtils::BEDWARS_LEVELS_PER_PRESTIGE); - } else if ($exp < 9000) { - return 4 + ($prestige * GameUtils::BEDWARS_LEVELS_PER_PRESTIGE); - } - - $exp -= 9000; - return ($exp / 5000 + 4) + ($prestige * GameUtils::BEDWARS_LEVELS_PER_PRESTIGE); - } - -} \ No newline at end of file diff --git a/src/util/games/BedwarsUtils.php b/src/util/games/BedwarsUtils.php new file mode 100644 index 0000000..72f3838 --- /dev/null +++ b/src/util/games/BedwarsUtils.php @@ -0,0 +1,47 @@ + 5) { + $over = $prestige % 5; + $exp += $over * BedWarsUtils::BEDWARS_EXP_PER_PRESTIGE; + $prestige -= $over; + } + + // first few levels are different + if ($exp < 500) { + return 0 + ($prestige * BedWarsUtils::BEDWARS_LEVELS_PER_PRESTIGE); + } else if ($exp < 1500) { + return 1 + ($prestige * BedWarsUtils::BEDWARS_LEVELS_PER_PRESTIGE); + } else if ($exp < 3500) { + return 2 + ($prestige * BedWarsUtils::BEDWARS_LEVELS_PER_PRESTIGE); + } else if ($exp < 5500) { + return 3 + ($prestige * BedWarsUtils::BEDWARS_LEVELS_PER_PRESTIGE); + } else if ($exp < 9000) { + return 4 + ($prestige * BedWarsUtils::BEDWARS_LEVELS_PER_PRESTIGE); + } + + $exp -= 9000; + return ($exp / 5000 + 4) + ($prestige * BedWarsUtils::BEDWARS_LEVELS_PER_PRESTIGE); + } + +} \ No newline at end of file diff --git a/src/util/games/GameUtils.php b/src/util/games/GameUtils.php new file mode 100644 index 0000000..1ced156 --- /dev/null +++ b/src/util/games/GameUtils.php @@ -0,0 +1,42 @@ +getInt(str_replace("%class%", strtolower($class['id']), $skill['field']), 1); + return max($minLevel, $level); + } + +} \ No newline at end of file