From 9d762e97e5ce47ebdcf99a21a5717a9a949b046b Mon Sep 17 00:00:00 2001 From: Pilow Date: Fri, 8 Dec 2023 12:03:40 +0100 Subject: [PATCH] t --- data/chips.json | 2 +- leekscript | 2 +- .../java/com/leekwars/generator/Data.java | 19 +++- .../leekwars/generator/FightConstants.java | 7 ++ .../leekwars/generator/FightFunctions.java | 10 +- .../com/leekwars/generator/Generator.java | 18 +++ .../java/com/leekwars/generator/Util.java | 1 + .../leekwars/generator/action/Actions.java | 21 +++- .../com/leekwars/generator/area/Area.java | 9 +- .../leekwars/generator/area/AreaAllies.java | 30 +++++ .../leekwars/generator/area/AreaEnemies.java | 29 +++++ .../generator/area/AreaFirstInLine.java | 3 +- .../generator/area/AreaLaserLine.java | 3 +- .../generator/area/AreaSingleCell.java | 3 +- .../com/leekwars/generator/area/MaskArea.java | 3 +- .../com/leekwars/generator/attack/Attack.java | 23 +++- .../generator/attack/EntityState.java | 2 +- .../generator/bulbs/BulbTemplate.java | 2 + .../com/leekwars/generator/chips/Chip.java | 1 + .../leekwars/generator/classes/ChipClass.java | 8 +- .../generator/classes/EntityClass.java | 29 ++++- .../generator/classes/NetworkClass.java | 5 + .../generator/component/Component.java | 37 +++++++ .../generator/component/Components.java | 24 ++++ .../com/leekwars/generator/effect/Effect.java | 11 ++ .../generator/effect/EffectAddState.java | 5 +- .../generator/effect/EffectAftereffect.java | 9 +- .../generator/effect/EffectDamage.java | 10 +- .../leekwars/generator/effect/EffectKill.java | 9 +- .../generator/effect/EffectLifeDamage.java | 11 +- .../generator/effect/EffectNovaDamage.java | 7 +- .../generator/effect/EffectPoison.java | 8 +- .../com/leekwars/generator/entity/Bulb.java | 8 +- .../com/leekwars/generator/fight/Fight.java | 5 + .../generator/fight/entity/EntityAI.java | 7 +- .../com/leekwars/generator/items/Items.java | 4 + .../com/leekwars/generator/leek/Leek.java | 4 +- .../java/com/leekwars/generator/maps/Map.java | 104 +++++++++++++++--- .../leekwars/generator/maps/ObstacleInfo.java | 62 +++++++++++ .../generator/scenario/EntityInfo.java | 15 ++- .../com/leekwars/generator/state/Entity.java | 74 +++++++++++-- .../com/leekwars/generator/state/State.java | 21 ++-- .../statistics/StatisticsManager.java | 3 +- .../generator/test/LocalTrophyManager.java | 3 +- .../leekwars/generator/weapons/Weapon.java | 1 + src/test/java/test/TestFightFunctions.java | 2 +- src/test/java/test/TestLeekFunctions.java | 4 +- 47 files changed, 586 insertions(+), 92 deletions(-) create mode 100644 src/main/java/com/leekwars/generator/area/AreaAllies.java create mode 100644 src/main/java/com/leekwars/generator/area/AreaEnemies.java create mode 100644 src/main/java/com/leekwars/generator/component/Component.java create mode 100644 src/main/java/com/leekwars/generator/component/Components.java create mode 100644 src/main/java/com/leekwars/generator/maps/ObstacleInfo.java diff --git a/data/chips.json b/data/chips.json index a8bbcfd..9b32be9 100644 --- a/data/chips.json +++ b/data/chips.json @@ -1 +1 @@ -{"1":{"area":1,"cooldown":0,"cost":2,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":5,"value2":2}],"id":1,"initial_cooldown":0,"launch_type":1,"level":2,"los":1,"max_range":6,"min_range":0,"name":"shock","team_cooldown":0,"template":6},"10":{"area":4,"cooldown":1,"cost":5,"effects":[{"id":2,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":35,"value2":5}],"id":10,"initial_cooldown":0,"launch_type":1,"level":56,"los":1,"max_range":6,"min_range":2,"name":"drip","team_cooldown":0,"template":3},"100":{"area":4,"cooldown":1,"cost":4,"effects":[{"id":20,"modifiers":0,"targets":30,"turns":3,"type":3,"value1":3,"value2":1}],"id":100,"initial_cooldown":0,"launch_type":1,"level":132,"los":1,"max_range":3,"min_range":0,"name":"thorn","team_cooldown":0,"template":64},"101":{"area":4,"cooldown":2,"cost":5,"effects":[{"id":20,"modifiers":0,"targets":30,"turns":3,"type":3,"value1":5,"value2":1}],"id":101,"initial_cooldown":0,"launch_type":1,"level":246,"los":1,"max_range":2,"min_range":0,"name":"mirror","team_cooldown":0,"template":65},"102":{"area":1,"cooldown":1,"cost":5,"effects":[{"id":3,"modifiers":0,"targets":22,"turns":2,"type":5,"value1":50,"value2":10}],"id":102,"initial_cooldown":0,"launch_type":1,"level":107,"los":1,"max_range":8,"min_range":1,"name":"ferocity","team_cooldown":0,"template":66},"103":{"area":1,"cooldown":1,"cost":5,"effects":[{"id":22,"modifiers":0,"targets":22,"turns":2,"type":5,"value1":60,"value2":10}],"id":103,"initial_cooldown":0,"launch_type":1,"level":182,"los":1,"max_range":6,"min_range":1,"name":"collar","team_cooldown":0,"template":67},"104":{"area":1,"cooldown":1,"cost":5,"effects":[{"id":21,"modifiers":0,"targets":22,"turns":2,"type":5,"value1":60,"value2":10}],"id":104,"initial_cooldown":0,"launch_type":1,"level":234,"los":1,"max_range":6,"min_range":1,"name":"bark","team_cooldown":0,"template":68},"105":{"area":5,"cooldown":4,"cost":5,"effects":[{"id":1,"modifiers":0,"targets":17,"turns":0,"type":1,"value1":78,"value2":9},{"id":13,"modifiers":0,"targets":17,"turns":1,"type":6,"value1":78,"value2":9},{"id":16,"modifiers":0,"targets":22,"turns":0,"type":1,"value1":0,"value2":0}],"id":105,"initial_cooldown":0,"launch_type":1,"level":209,"los":1,"max_range":6,"min_range":4,"name":"burning","team_cooldown":0,"template":69},"106":{"area":1,"cooldown":1,"cost":4,"effects":[{"id":19,"modifiers":1,"targets":31,"turns":2,"type":7,"value1":20,"value2":5}],"id":106,"initial_cooldown":0,"launch_type":1,"level":240,"los":1,"max_range":6,"min_range":1,"name":"fracture","team_cooldown":0,"template":59},"11":{"area":1,"cooldown":3,"cost":6,"effects":[{"id":2,"modifiers":0,"targets":30,"turns":3,"type":2,"value1":34,"value2":4}],"id":11,"initial_cooldown":0,"launch_type":1,"level":80,"los":1,"max_range":6,"min_range":0,"name":"vaccine","team_cooldown":0,"template":5},"110":{"area":1,"cooldown":4,"cost":3,"effects":[{"id":23,"modifiers":0,"targets":30,"turns":0,"type":9,"value1":0,"value2":0}],"id":110,"initial_cooldown":0,"launch_type":1,"level":114,"los":1,"max_range":4,"min_range":0,"name":"antidote","team_cooldown":0,"template":70},"114":{"area":1,"cooldown":3,"cost":5,"effects":[{"id":28,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":33.33333,"value2":0},{"id":28,"modifiers":4,"targets":31,"turns":0,"type":1,"value1":66.66666,"value2":0}],"id":114,"initial_cooldown":0,"launch_type":1,"level":147,"los":1,"max_range":1,"min_range":1,"name":"punishment","team_cooldown":0,"template":71},"12":{"area":6,"cooldown":2,"cost":4,"effects":[{"id":7,"modifiers":0,"targets":30,"turns":3,"type":5,"value1":0.5,"value2":0.1}],"id":12,"initial_cooldown":0,"launch_type":1,"level":203,"los":1,"max_range":8,"min_range":0,"name":"seven_league_boots","team_cooldown":0,"template":32},"120":{"area":9,"cooldown":2,"cost":2,"effects":[{"id":32,"modifiers":6,"targets":29,"turns":2,"type":5,"value1":1,"value2":0}],"id":120,"initial_cooldown":0,"launch_type":1,"level":139,"los":1,"max_range":8,"min_range":0,"name":"covetousness","team_cooldown":0,"template":72},"121":{"area":7,"cooldown":1,"cost":6,"effects":[{"id":2,"modifiers":6,"targets":29,"turns":0,"type":2,"value1":42,"value2":2}],"id":121,"initial_cooldown":0,"launch_type":1,"level":177,"los":1,"max_range":8,"min_range":0,"name":"vampirization","team_cooldown":0,"template":73},"122":{"area":9,"cooldown":2,"cost":3,"effects":[{"id":31,"modifiers":6,"targets":29,"turns":2,"type":5,"value1":1,"value2":0}],"id":122,"initial_cooldown":0,"launch_type":1,"level":192,"los":1,"max_range":8,"min_range":0,"name":"precipitation","team_cooldown":0,"template":74},"13":{"area":1,"cooldown":5,"cost":6,"effects":[{"id":31,"modifiers":0,"targets":14,"turns":1,"type":5,"value1":3,"value2":0}],"id":13,"initial_cooldown":0,"launch_type":1,"level":175,"los":1,"max_range":2,"min_range":0,"name":"winged_boots","team_cooldown":0,"template":31},"14":{"area":1,"cooldown":5,"cost":3,"effects":[{"id":31,"modifiers":0,"targets":30,"turns":2,"type":5,"value1":2,"value2":0}],"id":14,"initial_cooldown":0,"launch_type":1,"level":22,"los":1,"max_range":5,"min_range":0,"name":"leather_boots","team_cooldown":0,"template":30},"141":{"area":1,"cooldown":1,"cost":3,"effects":[{"id":30,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":18,"value2":2}],"id":141,"initial_cooldown":0,"launch_type":1,"level":53,"los":1,"max_range":12,"min_range":6,"name":"alteration","team_cooldown":0,"template":75},"142":{"area":1,"cooldown":7,"cost":15,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":8,"value2":0}],"id":142,"initial_cooldown":0,"launch_type":1,"level":215,"los":1,"max_range":3,"min_range":1,"name":"wizard_bulb","team_cooldown":1,"template":77},"143":{"area":6,"cooldown":3,"cost":9,"effects":[{"id":1,"modifiers":2,"targets":31,"turns":0,"type":1,"value1":35,"value2":2}],"id":143,"initial_cooldown":0,"launch_type":1,"level":290,"los":1,"max_range":6,"min_range":0,"name":"plasma","team_cooldown":0,"template":76},"144":{"area":1,"cooldown":3,"cost":4,"effects":[{"id":10,"modifiers":0,"targets":31,"turns":0,"type":9,"value1":0,"value2":0},{"id":41,"modifiers":4,"targets":31,"turns":2,"type":5,"value1":100,"value2":0}],"id":144,"initial_cooldown":0,"launch_type":1,"level":70,"los":0,"max_range":3,"min_range":1,"name":"jump","team_cooldown":0,"template":78},"15":{"area":1,"cooldown":6,"cost":4,"effects":[{"id":32,"modifiers":0,"targets":30,"turns":2,"type":5,"value1":3,"value2":0}],"id":15,"initial_cooldown":0,"launch_type":1,"level":14,"los":1,"max_range":5,"min_range":0,"name":"motivation","team_cooldown":0,"template":33},"152":{"area":1,"cooldown":7,"cost":8,"effects":[{"id":43,"modifiers":8,"targets":31,"turns":0,"type":6,"value1":2,"value2":0},{"id":13,"modifiers":8,"targets":31,"turns":7,"type":6,"value1":69,"value2":10}],"id":152,"initial_cooldown":0,"launch_type":1,"level":220,"los":1,"max_range":2,"min_range":0,"name":"covid","team_cooldown":0,"template":79},"154":{"area":1,"cooldown":-1,"cost":6,"effects":[{"id":12,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":80,"value2":0}],"id":154,"initial_cooldown":0,"launch_type":1,"level":228,"los":1,"max_range":5,"min_range":0,"name":"elevation","team_cooldown":0,"template":80},"155":{"area":1,"cooldown":4,"cost":5,"effects":[{"id":44,"modifiers":0,"targets":31,"turns":2,"type":5,"value1":150,"value2":20}],"id":155,"initial_cooldown":0,"launch_type":1,"level":32,"los":1,"max_range":7,"min_range":0,"name":"knowledge","team_cooldown":0,"template":81},"156":{"area":1,"cooldown":4,"cost":6,"effects":[{"id":39,"modifiers":0,"targets":31,"turns":2,"type":5,"value1":150,"value2":20}],"id":156,"initial_cooldown":0,"launch_type":1,"level":166,"los":1,"max_range":6,"min_range":0,"name":"wizardry","team_cooldown":0,"template":82},"157":{"area":1,"cooldown":4,"cost":4,"effects":[{"id":11,"modifiers":0,"targets":22,"turns":0,"type":9,"value1":0,"value2":0},{"id":1,"modifiers":0,"targets":22,"turns":0,"type":1,"value1":18,"value2":2}],"id":157,"initial_cooldown":0,"launch_type":1,"level":163,"los":0,"max_range":10,"min_range":1,"name":"repotting","team_cooldown":0,"template":83},"158":{"area":6,"cooldown":2,"cost":7,"effects":[{"id":2,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":75,"value2":5}],"id":158,"initial_cooldown":0,"launch_type":1,"level":260,"los":1,"max_range":5,"min_range":1,"name":"therapy","team_cooldown":0,"template":84},"159":{"area":12,"cooldown":3,"cost":7,"effects":[{"id":45,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":27,"value2":5}],"id":159,"initial_cooldown":0,"launch_type":1,"level":83,"los":1,"max_range":8,"min_range":0,"name":"mutation","team_cooldown":0,"template":85},"16":{"area":1,"cooldown":7,"cost":1,"effects":[{"id":32,"modifiers":0,"targets":14,"turns":1,"type":5,"value1":5,"value2":0}],"id":16,"initial_cooldown":0,"launch_type":1,"level":156,"los":1,"max_range":3,"min_range":0,"name":"adrenaline","team_cooldown":0,"template":34},"160":{"area":11,"cooldown":2,"cost":8,"effects":[{"id":30,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":70,"value2":10}],"id":160,"initial_cooldown":0,"launch_type":0,"level":223,"los":1,"max_range":6,"min_range":1,"name":"desintegration","team_cooldown":0,"template":86},"161":{"area":11,"cooldown":9,"cost":8,"effects":[{"id":45,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":55,"value2":4}],"id":161,"initial_cooldown":0,"launch_type":0,"level":252,"los":1,"max_range":6,"min_range":1,"name":"transmutation","team_cooldown":0,"template":87},"162":{"area":13,"cooldown":0,"cost":3,"effects":[{"id":46,"modifiers":0,"targets":31,"turns":0,"type":9,"value1":0,"value2":0}],"id":162,"initial_cooldown":0,"launch_type":0,"level":120,"los":1,"max_range":8,"min_range":1,"name":"grapple","team_cooldown":0,"template":88},"163":{"area":13,"cooldown":0,"cost":3,"effects":[{"id":51,"modifiers":0,"targets":31,"turns":0,"type":9,"value1":0,"value2":0}],"id":163,"initial_cooldown":0,"launch_type":0,"level":140,"los":0,"max_range":8,"min_range":2,"name":"boxing_glove","team_cooldown":0,"template":89},"166":{"area":1,"cooldown":7,"cost":16,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":11,"value2":0}],"id":166,"initial_cooldown":0,"launch_type":1,"level":270,"los":1,"max_range":3,"min_range":3,"name":"tactician_bulb","team_cooldown":1,"template":92},"167":{"area":1,"cooldown":7,"cost":16,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":12,"value2":0}],"id":167,"initial_cooldown":0,"launch_type":1,"level":250,"los":1,"max_range":4,"min_range":1,"name":"savant_bulb","team_cooldown":1,"template":93},"168":{"area":11,"cooldown":4,"cost":8,"effects":[{"id":2,"modifiers":0,"targets":30,"turns":4,"type":2,"value1":60,"value2":5}],"id":168,"initial_cooldown":0,"launch_type":0,"level":199,"los":1,"max_range":6,"min_range":0,"name":"serum","team_cooldown":0,"template":94},"169":{"area":1,"cooldown":2,"cost":6,"effects":[{"id":47,"modifiers":1,"targets":31,"turns":2,"type":7,"value1":45,"value2":4}],"id":169,"initial_cooldown":0,"launch_type":0,"level":158,"los":1,"max_range":6,"min_range":1,"name":"crushing","team_cooldown":0,"template":95},"17":{"area":5,"cooldown":2,"cost":4,"effects":[{"id":8,"modifiers":0,"targets":30,"turns":3,"type":5,"value1":0.5,"value2":0.1}],"id":17,"initial_cooldown":0,"launch_type":1,"level":226,"los":1,"max_range":8,"min_range":0,"name":"rage","team_cooldown":0,"template":35},"170":{"area":1,"cooldown":1,"cost":6,"effects":[{"id":48,"modifiers":1,"targets":31,"turns":2,"type":7,"value1":32,"value2":7}],"id":170,"initial_cooldown":0,"launch_type":0,"level":266,"los":1,"max_range":6,"min_range":1,"name":"brainwashing","team_cooldown":0,"template":96},"171":{"area":1,"cooldown":2,"cost":8,"effects":[{"id":13,"modifiers":1,"targets":31,"turns":2,"type":6,"value1":62,"value2":5}],"id":171,"initial_cooldown":0,"launch_type":1,"level":285,"los":0,"max_range":4,"min_range":3,"name":"arsenic","team_cooldown":0,"template":97},"172":{"area":1,"cooldown":8,"cost":4,"effects":[{"id":20,"modifiers":0,"targets":31,"turns":1,"type":3,"value1":25,"value2":0}],"id":172,"initial_cooldown":0,"launch_type":1,"level":278,"los":1,"max_range":7,"min_range":1,"name":"bramble","team_cooldown":0,"template":98},"173":{"area":5,"cooldown":8,"cost":9,"effects":[{"id":5,"modifiers":0,"targets":26,"turns":4,"type":4,"value1":12,"value2":2}],"id":173,"initial_cooldown":0,"launch_type":1,"level":243,"los":1,"max_range":0,"min_range":0,"name":"dome","team_cooldown":0,"template":99},"174":{"area":1,"cooldown":5,"cost":5,"effects":[{"id":49,"modifiers":0,"targets":31,"turns":0,"type":9,"value1":0,"value2":0}],"id":174,"initial_cooldown":0,"launch_type":0,"level":149,"los":1,"max_range":5,"min_range":0,"name":"manumission","team_cooldown":0,"template":100},"18":{"area":1,"cooldown":0,"cost":3,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":8,"value2":8}],"id":18,"initial_cooldown":0,"launch_type":1,"level":19,"los":0,"max_range":10,"min_range":0,"name":"spark","team_cooldown":0,"template":9},"19":{"area":1,"cooldown":1,"cost":2,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":2,"value2":32}],"id":19,"initial_cooldown":0,"launch_type":1,"level":4,"los":1,"max_range":5,"min_range":0,"name":"pebble","team_cooldown":0,"template":12},"2":{"area":1,"cooldown":0,"cost":4,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":17,"value2":2}],"id":2,"initial_cooldown":0,"launch_type":1,"level":9,"los":1,"max_range":8,"min_range":0,"name":"ice","team_cooldown":0,"template":15},"20":{"area":1,"cooldown":4,"cost":4,"effects":[{"id":6,"modifiers":0,"targets":30,"turns":3,"type":4,"value1":20,"value2":0}],"id":20,"initial_cooldown":0,"launch_type":1,"level":35,"los":1,"max_range":4,"min_range":0,"name":"shield","team_cooldown":0,"template":18},"21":{"area":1,"cooldown":3,"cost":3,"effects":[{"id":6,"modifiers":0,"targets":30,"turns":2,"type":4,"value1":15,"value2":0}],"id":21,"initial_cooldown":0,"launch_type":1,"level":10,"los":1,"max_range":4,"min_range":0,"name":"helmet","team_cooldown":0,"template":19},"22":{"area":1,"cooldown":5,"cost":6,"effects":[{"id":6,"modifiers":0,"targets":30,"turns":4,"type":4,"value1":25,"value2":0}],"id":22,"initial_cooldown":0,"launch_type":1,"level":74,"los":1,"max_range":4,"min_range":0,"name":"armor","team_cooldown":0,"template":20},"23":{"area":1,"cooldown":3,"cost":3,"effects":[{"id":5,"modifiers":0,"targets":30,"turns":2,"type":4,"value1":5,"value2":1}],"id":23,"initial_cooldown":0,"launch_type":1,"level":18,"los":1,"max_range":3,"min_range":0,"name":"wall","team_cooldown":0,"template":21},"24":{"area":1,"cooldown":2,"cost":5,"effects":[{"id":5,"modifiers":0,"targets":22,"turns":3,"type":4,"value1":9,"value2":1},{"id":5,"modifiers":0,"targets":14,"turns":3,"type":4,"value1":5,"value2":1}],"id":24,"initial_cooldown":0,"launch_type":1,"level":117,"los":1,"max_range":7,"min_range":2,"name":"rampart","team_cooldown":0,"template":22},"25":{"area":1,"cooldown":5,"cost":7,"effects":[{"id":38,"modifiers":0,"targets":30,"turns":3,"type":5,"value1":170,"value2":20}],"id":25,"initial_cooldown":0,"launch_type":1,"level":134,"los":1,"max_range":5,"min_range":0,"name":"steroid","team_cooldown":0,"template":25},"26":{"area":4,"cooldown":1,"cost":5,"effects":[{"id":3,"modifiers":0,"targets":30,"turns":3,"type":5,"value1":35,"value2":5},{"id":25,"modifiers":0,"targets":30,"turns":3,"type":0,"value1":35,"value2":5}],"id":26,"initial_cooldown":0,"launch_type":1,"level":207,"los":1,"max_range":6,"min_range":0,"name":"doping","team_cooldown":0,"template":26},"27":{"area":7,"cooldown":1,"cost":5,"effects":[{"id":4,"modifiers":0,"targets":30,"turns":3,"type":5,"value1":35,"value2":5}],"id":27,"initial_cooldown":0,"launch_type":1,"level":197,"los":1,"max_range":6,"min_range":0,"name":"reflexes","team_cooldown":0,"template":29},"28":{"area":1,"cooldown":5,"cost":7,"effects":[{"id":41,"modifiers":0,"targets":30,"turns":3,"type":5,"value1":170,"value2":20}],"id":28,"initial_cooldown":0,"launch_type":1,"level":127,"los":1,"max_range":3,"min_range":0,"name":"warm_up","team_cooldown":0,"template":28},"29":{"area":1,"cooldown":4,"cost":6,"effects":[{"id":5,"modifiers":0,"targets":30,"turns":3,"type":4,"value1":8,"value2":1}],"id":29,"initial_cooldown":0,"launch_type":1,"level":194,"los":1,"max_range":3,"min_range":0,"name":"fortress","team_cooldown":0,"template":23},"3":{"area":1,"cooldown":1,"cost":2,"effects":[{"id":2,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":10,"value2":5}],"id":3,"initial_cooldown":0,"launch_type":1,"level":3,"los":1,"max_range":6,"min_range":0,"name":"bandage","team_cooldown":0,"template":1},"30":{"area":1,"cooldown":3,"cost":6,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":64,"value2":3}],"id":30,"initial_cooldown":0,"launch_type":1,"level":50,"los":1,"max_range":7,"min_range":2,"name":"stalactite","team_cooldown":0,"template":16},"31":{"area":4,"cooldown":3,"cost":7,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":82,"value2":8}],"id":31,"initial_cooldown":0,"launch_type":0,"level":100,"los":1,"max_range":5,"min_range":3,"name":"iceberg","team_cooldown":0,"template":17},"32":{"area":4,"cooldown":1,"cost":5,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":48,"value2":8}],"id":32,"initial_cooldown":0,"launch_type":1,"level":77,"los":1,"max_range":7,"min_range":5,"name":"rockfall","team_cooldown":0,"template":14},"33":{"area":4,"cooldown":0,"cost":4,"effects":[{"id":1,"modifiers":0,"targets":27,"turns":0,"type":1,"value1":35,"value2":12}],"id":33,"initial_cooldown":0,"launch_type":0,"level":180,"los":1,"max_range":5,"min_range":2,"name":"lightning","team_cooldown":0,"template":8},"34":{"area":1,"cooldown":5,"cost":5,"effects":[{"id":9,"modifiers":0,"targets":31,"turns":0,"type":9,"value1":60,"value2":0}],"id":34,"initial_cooldown":0,"launch_type":1,"level":60,"los":1,"max_range":6,"min_range":0,"name":"liberation","team_cooldown":0,"template":36},"35":{"area":1,"cooldown":-1,"cost":8,"effects":[{"id":2,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":500,"value2":0}],"id":35,"initial_cooldown":0,"launch_type":1,"level":122,"los":1,"max_range":3,"min_range":0,"name":"regeneration","team_cooldown":0,"template":4},"36":{"area":4,"cooldown":3,"cost":8,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":70,"value2":10}],"id":36,"initial_cooldown":0,"launch_type":1,"level":160,"los":1,"max_range":9,"min_range":5,"name":"meteorite","team_cooldown":0,"template":11},"4":{"area":1,"cooldown":2,"cost":4,"effects":[{"id":2,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":35,"value2":8}],"id":4,"initial_cooldown":0,"launch_type":1,"level":20,"los":1,"max_range":5,"min_range":0,"name":"cure","team_cooldown":0,"template":2},"5":{"area":1,"cooldown":0,"cost":4,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":25,"value2":2}],"id":5,"initial_cooldown":0,"launch_type":1,"level":29,"los":1,"max_range":7,"min_range":2,"name":"flame","team_cooldown":0,"template":10},"59":{"area":1,"cooldown":10,"cost":7,"effects":[{"id":10,"modifiers":0,"targets":31,"turns":0,"type":9,"value1":0,"value2":0}],"id":59,"initial_cooldown":1,"launch_type":1,"level":200,"los":0,"max_range":12,"min_range":1,"name":"teleportation","team_cooldown":0,"template":37},"6":{"area":3,"cooldown":1,"cost":4,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":22,"value2":3}],"id":6,"initial_cooldown":0,"launch_type":0,"level":24,"los":1,"max_range":10,"min_range":1,"name":"flash","team_cooldown":0,"template":7},"67":{"area":1,"cooldown":5,"cost":5,"effects":[{"id":12,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":25,"value2":5}],"id":67,"initial_cooldown":0,"launch_type":1,"level":68,"los":1,"max_range":3,"min_range":0,"name":"armoring","team_cooldown":0,"template":38},"68":{"area":1,"cooldown":4,"cost":4,"effects":[{"id":11,"modifiers":0,"targets":31,"turns":0,"type":9,"value1":0,"value2":0},{"id":2,"modifiers":0,"targets":30,"turns":0,"type":2,"value1":50,"value2":0},{"id":26,"modifiers":1,"targets":29,"turns":1,"type":0,"value1":20,"value2":0}],"id":68,"initial_cooldown":1,"launch_type":0,"level":150,"los":1,"max_range":14,"min_range":1,"name":"inversion","team_cooldown":0,"template":39},"7":{"area":1,"cooldown":1,"cost":5,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":30,"value2":1}],"id":7,"initial_cooldown":0,"launch_type":1,"level":13,"los":1,"max_range":6,"min_range":2,"name":"rock","team_cooldown":0,"template":13},"73":{"area":1,"cooldown":4,"cost":6,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":1,"value2":0}],"id":73,"initial_cooldown":0,"launch_type":1,"level":48,"los":1,"max_range":3,"min_range":1,"name":"puny_bulb","team_cooldown":1,"template":40},"74":{"area":1,"cooldown":6,"cost":14,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":2,"value2":0}],"id":74,"initial_cooldown":0,"launch_type":1,"level":190,"los":1,"max_range":3,"min_range":2,"name":"fire_bulb","team_cooldown":1,"template":41},"75":{"area":1,"cooldown":7,"cost":14,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":3,"value2":0}],"id":75,"initial_cooldown":0,"launch_type":1,"level":174,"los":1,"max_range":2,"min_range":1,"name":"healer_bulb","team_cooldown":1,"template":42},"76":{"area":1,"cooldown":5,"cost":10,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":4,"value2":0}],"id":76,"initial_cooldown":0,"launch_type":1,"level":105,"los":1,"max_range":3,"min_range":1,"name":"rocky_bulb","team_cooldown":1,"template":43},"77":{"area":1,"cooldown":5,"cost":12,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":5,"value2":0}],"id":77,"initial_cooldown":0,"launch_type":1,"level":130,"los":1,"max_range":2,"min_range":1,"name":"iced_bulb","team_cooldown":1,"template":44},"78":{"area":1,"cooldown":6,"cost":16,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":6,"value2":0}],"id":78,"initial_cooldown":0,"launch_type":1,"level":280,"los":1,"max_range":5,"min_range":1,"name":"lightning_bulb","team_cooldown":1,"template":45},"79":{"area":1,"cooldown":7,"cost":16,"effects":[{"id":14,"modifiers":0,"targets":31,"turns":0,"type":8,"value1":7,"value2":0}],"id":79,"initial_cooldown":0,"launch_type":1,"level":230,"los":1,"max_range":1,"min_range":1,"name":"metallic_bulb","team_cooldown":1,"template":46},"8":{"area":1,"cooldown":3,"cost":3,"effects":[{"id":38,"modifiers":0,"targets":30,"turns":2,"type":5,"value1":80,"value2":20}],"id":8,"initial_cooldown":0,"launch_type":1,"level":6,"los":1,"max_range":4,"min_range":0,"name":"protein","team_cooldown":0,"template":24},"80":{"area":1,"cooldown":1,"cost":5,"effects":[{"id":2,"modifiers":0,"targets":30,"turns":0,"type":2,"value1":66,"value2":11}],"id":80,"initial_cooldown":0,"launch_type":1,"level":170,"los":1,"max_range":7,"min_range":0,"name":"remission","team_cooldown":0,"template":47},"81":{"area":1,"cooldown":1,"cost":5,"effects":[{"id":6,"modifiers":0,"targets":22,"turns":3,"type":4,"value1":55,"value2":0},{"id":6,"modifiers":0,"targets":14,"turns":3,"type":4,"value1":15,"value2":5}],"id":81,"initial_cooldown":0,"launch_type":1,"level":141,"los":1,"max_range":6,"min_range":1,"name":"carapace","team_cooldown":0,"template":48},"84":{"area":1,"cooldown":15,"cost":15,"effects":[{"id":15,"modifiers":0,"targets":31,"turns":0,"type":2,"value1":0,"value2":0}],"id":84,"initial_cooldown":0,"launch_type":1,"level":301,"los":1,"max_range":2,"min_range":1,"name":"resurrection","team_cooldown":0,"template":49},"85":{"area":5,"cooldown":3,"cost":6,"effects":[{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":25,"value2":0},{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":25,"value2":0},{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":25,"value2":0},{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":25,"value2":0},{"id":1,"modifiers":0,"targets":31,"turns":0,"type":1,"value1":25,"value2":0}],"id":85,"initial_cooldown":0,"launch_type":1,"level":171,"los":1,"max_range":0,"min_range":0,"name":"devil_strike","team_cooldown":0,"template":50},"88":{"area":1,"cooldown":1,"cost":4,"effects":[{"id":8,"modifiers":0,"targets":22,"turns":2,"type":5,"value1":0.6,"value2":0.1}],"id":88,"initial_cooldown":0,"launch_type":1,"level":119,"los":1,"max_range":6,"min_range":0,"name":"whip","team_cooldown":0,"template":51},"89":{"area":1,"cooldown":3,"cost":4,"effects":[{"id":12,"modifiers":0,"targets":22,"turns":0,"type":2,"value1":35,"value2":5},{"id":12,"modifiers":0,"targets":10,"turns":0,"type":2,"value1":10,"value2":5}],"id":89,"initial_cooldown":0,"launch_type":1,"level":111,"los":1,"max_range":7,"min_range":1,"name":"loam","team_cooldown":0,"template":52},"9":{"area":1,"cooldown":3,"cost":3,"effects":[{"id":41,"modifiers":0,"targets":30,"turns":2,"type":5,"value1":80,"value2":20}],"id":9,"initial_cooldown":0,"launch_type":1,"level":17,"los":1,"max_range":5,"min_range":0,"name":"stretching","team_cooldown":0,"template":27},"90":{"area":1,"cooldown":3,"cost":6,"effects":[{"id":12,"modifiers":0,"targets":22,"turns":0,"type":2,"value1":80,"value2":10}],"id":90,"initial_cooldown":0,"launch_type":1,"level":205,"los":1,"max_range":5,"min_range":1,"name":"fertilizer","team_cooldown":0,"template":53},"91":{"area":1,"cooldown":1,"cost":4,"effects":[{"id":7,"modifiers":0,"targets":22,"turns":2,"type":5,"value1":0.4,"value2":0.1}],"id":91,"initial_cooldown":0,"launch_type":1,"level":143,"los":1,"max_range":8,"min_range":0,"name":"acceleration","team_cooldown":0,"template":54},"92":{"area":1,"cooldown":0,"cost":3,"effects":[{"id":17,"modifiers":1,"targets":31,"turns":1,"type":7,"value1":0.3,"value2":0.1}],"id":92,"initial_cooldown":0,"launch_type":1,"level":98,"los":1,"max_range":8,"min_range":1,"name":"slow_down","team_cooldown":0,"template":55},"93":{"area":4,"cooldown":2,"cost":5,"effects":[{"id":17,"modifiers":1,"targets":31,"turns":2,"type":7,"value1":0.4,"value2":0.1}],"id":93,"initial_cooldown":0,"launch_type":1,"level":184,"los":1,"max_range":6,"min_range":1,"name":"ball_and_chain","team_cooldown":0,"template":56},"94":{"area":3,"cooldown":0,"cost":3,"effects":[{"id":18,"modifiers":1,"targets":31,"turns":1,"type":7,"value1":0.3,"value2":0.1}],"id":94,"initial_cooldown":0,"launch_type":1,"level":65,"los":1,"max_range":8,"min_range":1,"name":"tranquilizer","team_cooldown":0,"template":57},"95":{"area":5,"cooldown":1,"cost":5,"effects":[{"id":18,"modifiers":1,"targets":31,"turns":3,"type":7,"value1":0.4,"value2":0.1}],"id":95,"initial_cooldown":0,"launch_type":1,"level":145,"los":1,"max_range":6,"min_range":1,"name":"soporific","team_cooldown":0,"template":58},"96":{"area":1,"cooldown":5,"cost":6,"effects":[{"id":42,"modifiers":0,"targets":30,"turns":3,"type":5,"value1":200,"value2":30}],"id":96,"initial_cooldown":0,"launch_type":1,"level":40,"los":1,"max_range":3,"min_range":0,"name":"solidification","team_cooldown":0,"template":60},"97":{"area":1,"cooldown":1,"cost":4,"effects":[{"id":13,"modifiers":1,"targets":31,"turns":3,"type":6,"value1":15,"value2":5}],"id":97,"initial_cooldown":0,"launch_type":1,"level":62,"los":1,"max_range":10,"min_range":1,"name":"venom","team_cooldown":0,"template":61},"98":{"area":4,"cooldown":2,"cost":5,"effects":[{"id":13,"modifiers":1,"targets":31,"turns":3,"type":6,"value1":25,"value2":10}],"id":98,"initial_cooldown":0,"launch_type":1,"level":125,"los":1,"max_range":7,"min_range":1,"name":"toxin","team_cooldown":0,"template":62},"99":{"area":5,"cooldown":4,"cost":6,"effects":[{"id":13,"modifiers":1,"targets":31,"turns":4,"type":6,"value1":40,"value2":10}],"id":99,"initial_cooldown":0,"launch_type":1,"level":210,"los":1,"max_range":5,"min_range":1,"name":"plague","team_cooldown":0,"template":63}} \ No newline at end of file +{"418":{"id":418,"name":"apocalypse","level":1,"min_range":0,"max_range":0,"launch_type":7,"effects":[{"id":16,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":5,"area":14,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":112,"type":1},"419":{"id":419,"name":"divine_protection","level":1,"min_range":0,"max_range":0,"launch_type":7,"effects":[{"id":5,"value1":100,"value2":0,"turns":-1,"targets":31,"modifiers":16,"type":4}],"cost":5,"area":15,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":113,"type":4},"1":{"id":1,"name":"shock","level":2,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":1,"value1":7,"value2":2,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":2,"area":1,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":6,"type":1},"3":{"id":3,"name":"bandage","level":3,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":2,"value1":13,"value2":5,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":2,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":1,"type":2},"19":{"id":19,"name":"pebble","level":4,"min_range":0,"max_range":5,"launch_type":7,"effects":[{"id":1,"value1":2,"value2":32,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":2,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":12,"type":1},"8":{"id":8,"name":"protein","level":6,"min_range":0,"max_range":4,"launch_type":7,"effects":[{"id":38,"value1":80,"value2":20,"turns":2,"targets":30,"modifiers":0,"type":5}],"cost":3,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":24,"type":5},"2":{"id":2,"name":"ice","level":9,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":1,"value1":17,"value2":2,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":4,"area":1,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":15,"type":1},"21":{"id":21,"name":"helmet","level":10,"min_range":0,"max_range":4,"launch_type":7,"effects":[{"id":6,"value1":15,"value2":0,"turns":2,"targets":30,"modifiers":0,"type":4}],"cost":3,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":19,"type":4},"7":{"id":7,"name":"rock","level":13,"min_range":2,"max_range":6,"launch_type":7,"effects":[{"id":1,"value1":38,"value2":1,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":5,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":13,"type":1},"15":{"id":15,"name":"motivation","level":14,"min_range":0,"max_range":5,"launch_type":7,"effects":[{"id":32,"value1":3,"value2":0,"turns":2,"targets":30,"modifiers":0,"type":5}],"cost":4,"area":1,"cooldown":6,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":33,"type":5},"9":{"id":9,"name":"stretching","level":17,"min_range":0,"max_range":5,"launch_type":7,"effects":[{"id":41,"value1":80,"value2":20,"turns":2,"targets":30,"modifiers":0,"type":5}],"cost":3,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":27,"type":5},"23":{"id":23,"name":"wall","level":18,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":5,"value1":5,"value2":1,"turns":2,"targets":30,"modifiers":0,"type":4}],"cost":3,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":21,"type":4},"18":{"id":18,"name":"spark","level":19,"min_range":0,"max_range":10,"launch_type":7,"effects":[{"id":1,"value1":8,"value2":8,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":3,"area":1,"cooldown":0,"los":false,"team_cooldown":false,"initial_cooldown":0,"template":9,"type":1},"4":{"id":4,"name":"cure","level":20,"min_range":0,"max_range":5,"launch_type":7,"effects":[{"id":2,"value1":35,"value2":8,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":4,"area":1,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":2,"type":2},"14":{"id":14,"name":"leather_boots","level":22,"min_range":0,"max_range":5,"launch_type":7,"effects":[{"id":31,"value1":2,"value2":0,"turns":2,"targets":30,"modifiers":0,"type":5}],"cost":3,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":30,"type":5},"6":{"id":6,"name":"flash","level":24,"min_range":1,"max_range":10,"launch_type":1,"effects":[{"id":1,"value1":32,"value2":3,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":3,"area":3,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":7,"type":1},"5":{"id":5,"name":"flame","level":29,"min_range":2,"max_range":7,"launch_type":7,"effects":[{"id":1,"value1":29,"value2":2,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":4,"area":1,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":10,"type":1},"155":{"id":155,"name":"knowledge","level":32,"min_range":0,"max_range":7,"launch_type":7,"effects":[{"id":44,"value1":150,"value2":20,"turns":2,"targets":31,"modifiers":0,"type":5}],"cost":5,"area":1,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":81,"type":5},"20":{"id":20,"name":"shield","level":35,"min_range":0,"max_range":4,"launch_type":7,"effects":[{"id":6,"value1":20,"value2":0,"turns":3,"targets":30,"modifiers":0,"type":4}],"cost":4,"area":1,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":18,"type":4},"96":{"id":96,"name":"solidification","level":40,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":42,"value1":190,"value2":30,"turns":3,"targets":30,"modifiers":0,"type":5}],"cost":6,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":60,"type":5},"97":{"id":97,"name":"venom","level":42,"min_range":1,"max_range":10,"launch_type":7,"effects":[{"id":13,"value1":15,"value2":5,"turns":3,"targets":31,"modifiers":1,"type":6}],"cost":4,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":61,"type":6},"73":{"id":73,"name":"puny_bulb","level":48,"min_range":1,"max_range":3,"launch_type":7,"effects":[{"id":14,"value1":1,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":6,"area":1,"cooldown":4,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":40,"type":8},"412":{"id":412,"name":"kemuridama","level":50,"min_range":1,"max_range":50,"launch_type":7,"effects":[{"id":10,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9}],"cost":8,"area":1,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":106,"type":9},"411":{"id":411,"name":"shuriken","level":50,"min_range":1,"max_range":10,"launch_type":1,"effects":[{"id":1,"value1":50,"value2":10,"turns":0,"targets":31,"modifiers":0,"type":1},{"id":26,"value1":30,"value2":0,"turns":2,"targets":31,"modifiers":0,"type":0}],"cost":6,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":105,"type":1},"30":{"id":30,"name":"stalactite","level":50,"min_range":2,"max_range":7,"launch_type":7,"effects":[{"id":1,"value1":64,"value2":3,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":6,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":16,"type":1},"141":{"id":141,"name":"alteration","level":53,"min_range":6,"max_range":12,"launch_type":7,"effects":[{"id":30,"value1":18,"value2":2,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":3,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":75,"type":1},"10":{"id":10,"name":"drip","level":56,"min_range":2,"max_range":6,"launch_type":7,"effects":[{"id":2,"value1":35,"value2":5,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":5,"area":4,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":3,"type":2},"34":{"id":34,"name":"liberation","level":60,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":9,"value1":60,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9}],"cost":5,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":36,"type":9},"94":{"id":94,"name":"tranquilizer","level":65,"min_range":1,"max_range":8,"launch_type":7,"effects":[{"id":18,"value1":0.3,"value2":0.1,"turns":1,"targets":31,"modifiers":1,"type":7}],"cost":3,"area":3,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":57,"type":7},"67":{"id":67,"name":"armoring","level":68,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":12,"value1":25,"value2":5,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":5,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":38,"type":2},"144":{"id":144,"name":"jump","level":70,"min_range":1,"max_range":3,"launch_type":7,"effects":[{"id":10,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9},{"id":41,"value1":100,"value2":0,"turns":2,"targets":31,"modifiers":4,"type":5}],"cost":4,"area":1,"cooldown":3,"los":false,"team_cooldown":false,"initial_cooldown":0,"template":78,"type":9},"22":{"id":22,"name":"armor","level":74,"min_range":0,"max_range":4,"launch_type":7,"effects":[{"id":6,"value1":25,"value2":0,"turns":4,"targets":30,"modifiers":0,"type":4}],"cost":6,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":20,"type":4},"32":{"id":32,"name":"rockfall","level":77,"min_range":5,"max_range":7,"launch_type":7,"effects":[{"id":1,"value1":50,"value2":8,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":5,"area":4,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":14,"type":1},"11":{"id":11,"name":"vaccine","level":80,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":2,"value1":38,"value2":4,"turns":3,"targets":30,"modifiers":0,"type":2}],"cost":6,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":5,"type":2},"159":{"id":159,"name":"mutation","level":83,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":45,"value1":20,"value2":5,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":7,"area":12,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":85,"type":2},"276":{"id":276,"name":"prism","level":92,"min_range":0,"max_range":6,"launch_type":4,"effects":[{"id":38,"value1":60,"value2":0,"turns":2,"targets":31,"modifiers":0,"type":5},{"id":44,"value1":60,"value2":0,"turns":2,"targets":31,"modifiers":0,"type":5},{"id":41,"value1":60,"value2":0,"turns":2,"targets":31,"modifiers":0,"type":5},{"id":42,"value1":60,"value2":0,"turns":2,"targets":31,"modifiers":0,"type":5},{"id":40,"value1":60,"value2":0,"turns":2,"targets":31,"modifiers":0,"type":5},{"id":39,"value1":60,"value2":0,"turns":2,"targets":31,"modifiers":0,"type":5}],"cost":6,"area":1,"cooldown":6,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":104,"type":5},"92":{"id":92,"name":"slow_down","level":98,"min_range":1,"max_range":8,"launch_type":7,"effects":[{"id":17,"value1":0.3,"value2":0.1,"turns":1,"targets":31,"modifiers":1,"type":7}],"cost":3,"area":1,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":55,"type":7},"413":{"id":413,"name":"fire_ball","level":100,"min_range":3,"max_range":6,"launch_type":7,"effects":[{"id":1,"value1":80,"value2":10,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":6,"area":3,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":107,"type":1},"417":{"id":417,"name":"kill","level":100,"min_range":1,"max_range":50,"launch_type":7,"effects":[{"id":16,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":1,"area":1,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":111,"type":1},"31":{"id":31,"name":"iceberg","level":100,"min_range":3,"max_range":5,"launch_type":1,"effects":[{"id":1,"value1":82,"value2":8,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":7,"area":4,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":17,"type":1},"414":{"id":414,"name":"trebuchet","level":100,"min_range":3,"max_range":50,"launch_type":7,"effects":[{"id":1,"value1":200,"value2":20,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":12,"area":5,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":108,"type":1},"76":{"id":76,"name":"rocky_bulb","level":105,"min_range":1,"max_range":3,"launch_type":7,"effects":[{"id":14,"value1":4,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":10,"area":1,"cooldown":5,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":43,"type":8},"102":{"id":102,"name":"ferocity","level":107,"min_range":1,"max_range":8,"launch_type":7,"effects":[{"id":3,"value1":50,"value2":10,"turns":2,"targets":22,"modifiers":0,"type":5}],"cost":5,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":66,"type":5},"89":{"id":89,"name":"loam","level":111,"min_range":1,"max_range":7,"launch_type":7,"effects":[{"id":12,"value1":43,"value2":5,"turns":0,"targets":22,"modifiers":0,"type":2},{"id":12,"value1":13,"value2":5,"turns":0,"targets":10,"modifiers":0,"type":2}],"cost":4,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":52,"type":2},"110":{"id":110,"name":"antidote","level":114,"min_range":0,"max_range":4,"launch_type":7,"effects":[{"id":23,"value1":0,"value2":0,"turns":0,"targets":30,"modifiers":0,"type":9}],"cost":3,"area":1,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":70,"type":9},"24":{"id":24,"name":"rampart","level":117,"min_range":2,"max_range":7,"launch_type":7,"effects":[{"id":5,"value1":9,"value2":1,"turns":3,"targets":22,"modifiers":0,"type":4},{"id":5,"value1":5,"value2":1,"turns":3,"targets":14,"modifiers":0,"type":4}],"cost":5,"area":1,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":22,"type":4},"88":{"id":88,"name":"whip","level":119,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":8,"value1":0.6,"value2":0.1,"turns":2,"targets":22,"modifiers":0,"type":5}],"cost":4,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":51,"type":5},"162":{"id":162,"name":"grapple","level":120,"min_range":1,"max_range":8,"launch_type":1,"effects":[{"id":46,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9}],"cost":3,"area":13,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":88,"type":9},"35":{"id":35,"name":"regeneration","level":122,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":2,"value1":500,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":8,"area":1,"cooldown":-1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":4,"type":2},"98":{"id":98,"name":"toxin","level":125,"min_range":1,"max_range":7,"launch_type":7,"effects":[{"id":13,"value1":25,"value2":10,"turns":3,"targets":31,"modifiers":1,"type":6}],"cost":5,"area":4,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":62,"type":6},"28":{"id":28,"name":"warm_up","level":127,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":41,"value1":190,"value2":20,"turns":3,"targets":30,"modifiers":0,"type":5}],"cost":7,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":28,"type":5},"77":{"id":77,"name":"iced_bulb","level":130,"min_range":1,"max_range":2,"launch_type":7,"effects":[{"id":14,"value1":5,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":12,"area":1,"cooldown":5,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":44,"type":8},"100":{"id":100,"name":"thorn","level":132,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":20,"value1":3,"value2":1,"turns":2,"targets":30,"modifiers":0,"type":3}],"cost":4,"area":3,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":64,"type":3},"25":{"id":25,"name":"steroid","level":134,"min_range":0,"max_range":5,"launch_type":7,"effects":[{"id":38,"value1":170,"value2":20,"turns":3,"targets":30,"modifiers":0,"type":5}],"cost":7,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":25,"type":5},"120":{"id":120,"name":"covetousness","level":139,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":32,"value1":1,"value2":0,"turns":2,"targets":29,"modifiers":6,"type":5}],"cost":2,"area":9,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":72,"type":5},"163":{"id":163,"name":"boxing_glove","level":140,"min_range":2,"max_range":8,"launch_type":1,"effects":[{"id":51,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9}],"cost":3,"area":13,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":89,"type":9},"81":{"id":81,"name":"carapace","level":141,"min_range":1,"max_range":6,"launch_type":7,"effects":[{"id":6,"value1":55,"value2":0,"turns":3,"targets":22,"modifiers":0,"type":4},{"id":6,"value1":15,"value2":5,"turns":3,"targets":14,"modifiers":0,"type":4}],"cost":5,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":48,"type":4},"91":{"id":91,"name":"acceleration","level":143,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":7,"value1":0.4,"value2":0.1,"turns":2,"targets":22,"modifiers":0,"type":5}],"cost":4,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":54,"type":5},"95":{"id":95,"name":"soporific","level":145,"min_range":1,"max_range":6,"launch_type":7,"effects":[{"id":18,"value1":0.4,"value2":0.1,"turns":3,"targets":31,"modifiers":1,"type":7}],"cost":5,"area":5,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":58,"type":7},"114":{"id":114,"name":"punishment","level":147,"min_range":1,"max_range":1,"launch_type":7,"effects":[{"id":28,"value1":25,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1},{"id":28,"value1":75,"value2":0,"turns":0,"targets":31,"modifiers":4,"type":1}],"cost":5,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":71,"type":1},"174":{"id":174,"name":"manumission","level":149,"min_range":0,"max_range":5,"launch_type":1,"effects":[{"id":49,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9}],"cost":5,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":100,"type":9},"68":{"id":68,"name":"inversion","level":150,"min_range":1,"max_range":14,"launch_type":1,"effects":[{"id":11,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9},{"id":2,"value1":50,"value2":0,"turns":0,"targets":30,"modifiers":0,"type":2},{"id":26,"value1":20,"value2":0,"turns":1,"targets":29,"modifiers":1,"type":0}],"cost":4,"area":1,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":1,"template":39,"type":9},"16":{"id":16,"name":"adrenaline","level":156,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":32,"value1":5,"value2":0,"turns":1,"targets":14,"modifiers":0,"type":5}],"cost":1,"area":1,"cooldown":7,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":34,"type":5},"169":{"id":169,"name":"crushing","level":158,"min_range":1,"max_range":8,"launch_type":3,"effects":[{"id":47,"value1":45,"value2":4,"turns":2,"targets":31,"modifiers":1,"type":7}],"cost":6,"area":1,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":95,"type":7},"36":{"id":36,"name":"meteorite","level":160,"min_range":5,"max_range":9,"launch_type":7,"effects":[{"id":1,"value1":70,"value2":10,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":8,"area":4,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":11,"type":1},"157":{"id":157,"name":"repotting","level":163,"min_range":1,"max_range":14,"launch_type":7,"effects":[{"id":11,"value1":0,"value2":0,"turns":0,"targets":22,"modifiers":0,"type":9},{"id":1,"value1":18,"value2":2,"turns":0,"targets":22,"modifiers":0,"type":1}],"cost":4,"area":1,"cooldown":2,"los":false,"team_cooldown":false,"initial_cooldown":0,"template":83,"type":9},"156":{"id":156,"name":"wizardry","level":166,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":39,"value1":150,"value2":20,"turns":2,"targets":31,"modifiers":0,"type":5}],"cost":6,"area":1,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":82,"type":5},"80":{"id":80,"name":"remission","level":170,"min_range":0,"max_range":7,"launch_type":7,"effects":[{"id":2,"value1":66,"value2":11,"turns":0,"targets":30,"modifiers":0,"type":2}],"cost":5,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":47,"type":2},"85":{"id":85,"name":"devil_strike","level":171,"min_range":0,"max_range":0,"launch_type":7,"effects":[{"id":1,"value1":25,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1},{"id":1,"value1":25,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1},{"id":1,"value1":25,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1},{"id":1,"value1":25,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1},{"id":1,"value1":25,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":6,"area":5,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":50,"type":1},"75":{"id":75,"name":"healer_bulb","level":174,"min_range":1,"max_range":2,"launch_type":7,"effects":[{"id":14,"value1":3,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":14,"area":1,"cooldown":7,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":42,"type":8},"13":{"id":13,"name":"winged_boots","level":175,"min_range":0,"max_range":2,"launch_type":7,"effects":[{"id":31,"value1":3,"value2":0,"turns":1,"targets":14,"modifiers":0,"type":5}],"cost":6,"area":1,"cooldown":5,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":31,"type":5},"121":{"id":121,"name":"vampirization","level":177,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":2,"value1":42,"value2":2,"turns":0,"targets":29,"modifiers":6,"type":2}],"cost":6,"area":7,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":73,"type":2},"33":{"id":33,"name":"lightning","level":180,"min_range":2,"max_range":5,"launch_type":1,"effects":[{"id":1,"value1":35,"value2":12,"turns":0,"targets":27,"modifiers":0,"type":1}],"cost":4,"area":4,"cooldown":0,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":8,"type":1},"103":{"id":103,"name":"collar","level":182,"min_range":1,"max_range":6,"launch_type":7,"effects":[{"id":22,"value1":80,"value2":10,"turns":2,"targets":22,"modifiers":0,"type":5}],"cost":5,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":67,"type":5},"93":{"id":93,"name":"ball_and_chain","level":184,"min_range":1,"max_range":6,"launch_type":7,"effects":[{"id":17,"value1":0.4,"value2":0.1,"turns":2,"targets":31,"modifiers":1,"type":7}],"cost":5,"area":4,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":56,"type":7},"74":{"id":74,"name":"fire_bulb","level":190,"min_range":2,"max_range":3,"launch_type":7,"effects":[{"id":14,"value1":2,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":14,"area":1,"cooldown":6,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":41,"type":8},"122":{"id":122,"name":"precipitation","level":192,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":31,"value1":1,"value2":0,"turns":2,"targets":29,"modifiers":6,"type":5}],"cost":3,"area":9,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":74,"type":5},"29":{"id":29,"name":"fortress","level":194,"min_range":0,"max_range":3,"launch_type":7,"effects":[{"id":5,"value1":8,"value2":1,"turns":3,"targets":30,"modifiers":0,"type":4}],"cost":6,"area":1,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":23,"type":4},"27":{"id":27,"name":"reflexes","level":197,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":4,"value1":35,"value2":5,"turns":3,"targets":30,"modifiers":0,"type":5}],"cost":5,"area":7,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":29,"type":5},"168":{"id":168,"name":"serum","level":199,"min_range":0,"max_range":6,"launch_type":1,"effects":[{"id":2,"value1":50,"value2":5,"turns":4,"targets":30,"modifiers":0,"type":2}],"cost":8,"area":11,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":94,"type":2},"415":{"id":415,"name":"awakening","level":200,"min_range":1,"max_range":50,"launch_type":7,"effects":[{"id":15,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":10,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":109,"type":2},"59":{"id":59,"name":"teleportation","level":200,"min_range":1,"max_range":12,"launch_type":7,"effects":[{"id":10,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":9}],"cost":7,"area":1,"cooldown":10,"los":false,"team_cooldown":false,"initial_cooldown":1,"template":37,"type":9},"416":{"id":416,"name":"thunder","level":200,"min_range":3,"max_range":8,"launch_type":7,"effects":[{"id":1,"value1":100,"value2":20,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":8,"area":4,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":110,"type":1},"12":{"id":12,"name":"seven_league_boots","level":203,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":7,"value1":0.5,"value2":0.1,"turns":3,"targets":30,"modifiers":0,"type":5}],"cost":4,"area":6,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":32,"type":5},"90":{"id":90,"name":"fertilizer","level":205,"min_range":1,"max_range":5,"launch_type":7,"effects":[{"id":12,"value1":80,"value2":10,"turns":0,"targets":22,"modifiers":0,"type":2}],"cost":6,"area":1,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":53,"type":2},"26":{"id":26,"name":"doping","level":207,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":3,"value1":35,"value2":5,"turns":3,"targets":30,"modifiers":0,"type":5},{"id":25,"value1":35,"value2":5,"turns":3,"targets":30,"modifiers":0,"type":0}],"cost":5,"area":4,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":26,"type":5},"105":{"id":105,"name":"burning","level":209,"min_range":4,"max_range":6,"launch_type":7,"effects":[{"id":1,"value1":78,"value2":9,"turns":0,"targets":17,"modifiers":0,"type":1},{"id":13,"value1":78,"value2":9,"turns":1,"targets":17,"modifiers":1,"type":6},{"id":16,"value1":0,"value2":0,"turns":0,"targets":22,"modifiers":0,"type":1}],"cost":5,"area":5,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":69,"type":1},"99":{"id":99,"name":"plague","level":210,"min_range":1,"max_range":5,"launch_type":7,"effects":[{"id":13,"value1":40,"value2":10,"turns":4,"targets":31,"modifiers":1,"type":6}],"cost":6,"area":5,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":63,"type":6},"142":{"id":142,"name":"wizard_bulb","level":215,"min_range":1,"max_range":3,"launch_type":7,"effects":[{"id":14,"value1":8,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":15,"area":1,"cooldown":7,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":77,"type":8},"152":{"id":152,"name":"covid","level":220,"min_range":0,"max_range":2,"launch_type":7,"effects":[{"id":43,"value1":2,"value2":0,"turns":0,"targets":31,"modifiers":8,"type":6},{"id":13,"value1":69,"value2":10,"turns":7,"targets":31,"modifiers":8,"type":6}],"cost":8,"area":1,"cooldown":7,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":79,"type":6},"160":{"id":160,"name":"desintegration","level":223,"min_range":1,"max_range":6,"launch_type":1,"effects":[{"id":30,"value1":70,"value2":10,"turns":0,"targets":31,"modifiers":0,"type":1}],"cost":8,"area":11,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":86,"type":1},"17":{"id":17,"name":"rage","level":226,"min_range":0,"max_range":8,"launch_type":7,"effects":[{"id":8,"value1":0.5,"value2":0.1,"turns":3,"targets":30,"modifiers":0,"type":5}],"cost":4,"area":5,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":35,"type":5},"154":{"id":154,"name":"elevation","level":228,"min_range":0,"max_range":5,"launch_type":7,"effects":[{"id":12,"value1":80,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":6,"area":1,"cooldown":-1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":80,"type":2},"79":{"id":79,"name":"metallic_bulb","level":230,"min_range":1,"max_range":1,"launch_type":7,"effects":[{"id":14,"value1":7,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":16,"area":1,"cooldown":7,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":46,"type":8},"104":{"id":104,"name":"bark","level":234,"min_range":1,"max_range":6,"launch_type":7,"effects":[{"id":21,"value1":60,"value2":10,"turns":2,"targets":22,"modifiers":0,"type":5}],"cost":5,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":68,"type":5},"106":{"id":106,"name":"fracture","level":240,"min_range":1,"max_range":6,"launch_type":7,"effects":[{"id":19,"value1":20,"value2":5,"turns":2,"targets":31,"modifiers":1,"type":7}],"cost":4,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":59,"type":7},"173":{"id":173,"name":"dome","level":243,"min_range":0,"max_range":0,"launch_type":7,"effects":[{"id":5,"value1":12,"value2":2,"turns":4,"targets":26,"modifiers":0,"type":4}],"cost":9,"area":5,"cooldown":8,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":99,"type":4},"101":{"id":101,"name":"mirror","level":246,"min_range":0,"max_range":2,"launch_type":7,"effects":[{"id":20,"value1":5,"value2":1,"turns":3,"targets":30,"modifiers":0,"type":3}],"cost":5,"area":4,"cooldown":4,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":65,"type":3},"167":{"id":167,"name":"savant_bulb","level":250,"min_range":1,"max_range":4,"launch_type":7,"effects":[{"id":14,"value1":12,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":16,"area":1,"cooldown":7,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":93,"type":8},"161":{"id":161,"name":"transmutation","level":252,"min_range":1,"max_range":6,"launch_type":1,"effects":[{"id":45,"value1":55,"value2":4,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":8,"area":11,"cooldown":9,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":87,"type":2},"158":{"id":158,"name":"therapy","level":260,"min_range":1,"max_range":5,"launch_type":7,"effects":[{"id":2,"value1":75,"value2":5,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":7,"area":6,"cooldown":2,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":84,"type":2},"170":{"id":170,"name":"brainwashing","level":266,"min_range":1,"max_range":8,"launch_type":3,"effects":[{"id":48,"value1":32,"value2":7,"turns":2,"targets":31,"modifiers":1,"type":7}],"cost":6,"area":1,"cooldown":1,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":96,"type":7},"166":{"id":166,"name":"tactician_bulb","level":270,"min_range":3,"max_range":3,"launch_type":7,"effects":[{"id":14,"value1":11,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":16,"area":1,"cooldown":7,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":92,"type":8},"172":{"id":172,"name":"bramble","level":278,"min_range":0,"max_range":7,"launch_type":7,"effects":[{"id":20,"value1":25,"value2":0,"turns":1,"targets":31,"modifiers":0,"type":3}],"cost":4,"area":1,"cooldown":8,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":98,"type":3},"78":{"id":78,"name":"lightning_bulb","level":280,"min_range":1,"max_range":5,"launch_type":7,"effects":[{"id":14,"value1":6,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":8}],"cost":16,"area":1,"cooldown":6,"los":true,"team_cooldown":true,"initial_cooldown":0,"template":45,"type":8},"171":{"id":171,"name":"arsenic","level":285,"min_range":3,"max_range":4,"launch_type":7,"effects":[{"id":13,"value1":62,"value2":5,"turns":2,"targets":31,"modifiers":1,"type":6}],"cost":8,"area":1,"cooldown":2,"los":false,"team_cooldown":false,"initial_cooldown":0,"template":97,"type":6},"143":{"id":143,"name":"plasma","level":290,"min_range":0,"max_range":6,"launch_type":7,"effects":[{"id":1,"value1":35,"value2":2,"turns":0,"targets":31,"modifiers":2,"type":1}],"cost":9,"area":6,"cooldown":3,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":76,"type":1},"84":{"id":84,"name":"resurrection","level":301,"min_range":1,"max_range":2,"launch_type":7,"effects":[{"id":15,"value1":0,"value2":0,"turns":0,"targets":31,"modifiers":0,"type":2}],"cost":15,"area":1,"cooldown":15,"los":true,"team_cooldown":false,"initial_cooldown":0,"template":49,"type":2}} \ No newline at end of file diff --git a/leekscript b/leekscript index 0a32321..f0c0853 160000 --- a/leekscript +++ b/leekscript @@ -1 +1 @@ -Subproject commit 0a323214afe25d2fc71f961af43edde9e847c8a6 +Subproject commit f0c085341338b06913df8cfa4ab9bb51602ef569 diff --git a/src/main/java/com/leekwars/generator/Data.java b/src/main/java/com/leekwars/generator/Data.java index 813cc4d..32e3597 100644 --- a/src/main/java/com/leekwars/generator/Data.java +++ b/src/main/java/com/leekwars/generator/Data.java @@ -1,5 +1,6 @@ package com.leekwars.generator; +import java.io.File; import java.io.IOException; import java.net.URI; import java.net.http.HttpClient; @@ -24,24 +25,27 @@ public class Data { public static List fullmoon = new ArrayList<>(); public static void checkData(String api) { - Log.i(TAG, "Check api: " + api); + + new File("data").mkdir(); + + System.out.println("Check api: " + api); // File weaponsFile = new File("data/weapons.json"); - Log.i(TAG, "Load weapons from API..."); + System.out.println("Load weapons from API..."); JSONObject weapons = JSON.parseObject(get(api + "weapon/get-all", "")).getJSONObject("weapons"); Util.writeFile(weapons.toJSONString(), "data/weapons.json"); // File chipsFile = new File("data/chips.json"); - Log.i(TAG, "Load chips from API..."); + System.out.println("Load chips from API..."); JSONObject chips = JSON.parseObject(get(api + "chip/get-all", "")).getJSONObject("chips"); Util.writeFile(chips.toJSONString(), "data/chips.json"); // File summonsFile = new File("data/summons.json"); - Log.i(TAG, "Load summons from API..."); + System.out.println("Load summons from API..."); JSONObject summons = JSON.parseObject(get(api + "summon/get-templates", "")).getJSONObject("summon_templates"); Util.writeFile(summons.toJSONString(), "data/summons.json"); // File fullmoonFile = new File("data/fullmoon.json"); - Log.i(TAG, "Load fullmoon from API..."); + System.out.println("Load fullmoon from API..."); JSONArray f = JSON.parseArray(get(api + "fight/fullmoon", "")); for (var d : f) { var dateUTC = ZonedDateTime.of(LocalDateTime.parse((String) d), ZoneOffset.UTC); @@ -50,6 +54,11 @@ public static void checkData(String api) { } // System.out.println("full moon = " + fullmoon); Util.writeFile(f.toJSONString(), "data/fullmoon.json"); + + // TODO + System.out.println("Load components from API..."); + JSONObject components = JSON.parseObject(get(api + "component/get-all/dfgdfgzegktyrtytm", "")); + Util.writeFile(components.toJSONString(), "data/components.json"); } private static String get(String url, String urlParameters) { diff --git a/src/main/java/com/leekwars/generator/FightConstants.java b/src/main/java/com/leekwars/generator/FightConstants.java index 72c27e7..99ac704 100644 --- a/src/main/java/com/leekwars/generator/FightConstants.java +++ b/src/main/java/com/leekwars/generator/FightConstants.java @@ -22,6 +22,7 @@ public enum FightConstants implements ILeekConstant { ENTITY_BULB(2, Type.INT), ENTITY_TURRET(3, Type.INT), ENTITY_CHEST(4, Type.INT), + ENTITY_MOB(5, Type.INT), // Constants EFFECT_TARGET_ALLIES(Effect.TARGET_ALLIES, Type.INT), @@ -109,8 +110,10 @@ public enum FightConstants implements ILeekConstant { EFFECT_KILL_TO_TP(Effect.TYPE_KILL_TO_TP, Type.INT), EFFECT_RAW_HEAL(Effect.TYPE_RAW_HEAL, Type.INT), EFFECT_CRITICAL_TO_HEAL(Effect.TYPE_CRITICAL_TO_HEAL, Type.INT), + EFFECT_ADD_STATE(Effect.TYPE_ADD_STATE, Type.INT), STATE_UNHEALABLE(EntityState.UNHEALABLE.ordinal(), Type.INT), + STATE_INVINCIBLE(EntityState.INVINCIBLE.ordinal(), Type.INT), // Résultats attaque USE_CRITICAL(2, Type.INT), @@ -159,6 +162,9 @@ public enum FightConstants implements ILeekConstant { WEAPON_UNSTABLE_DESTROYER(226, Type.INT), WEAPON_SWORD(277, Type.INT), WEAPON_HEAVY_SWORD(278, Type.INT), + WEAPON_ODACHI(408, Type.INT), + WEAPON_EXCALIBUR(409, Type.INT), + WEAPON_SCYTHE(410, Type.INT), // Messages MESSAGE_HEAL(1, Type.INT), @@ -316,6 +322,7 @@ public enum FightConstants implements ILeekConstant { FIGHT_TYPE_FARMER(Fight.TYPE_FARMER, Type.INT), FIGHT_TYPE_TEAM(Fight.TYPE_TEAM, Type.INT), FIGHT_TYPE_BATTLE_ROYALE(Fight.TYPE_BATTLE_ROYALE, Type.INT), + FIGHT_TYPE_BOSS(Fight.TYPE_BOSS, Type.INT), FIGHT_CONTEXT_TEST(Fight.CONTEXT_TEST, Type.INT), FIGHT_CONTEXT_GARDEN(Fight.CONTEXT_GARDEN, Type.INT), diff --git a/src/main/java/com/leekwars/generator/FightFunctions.java b/src/main/java/com/leekwars/generator/FightFunctions.java index 40227d2..81f1d09 100644 --- a/src/main/java/com/leekwars/generator/FightFunctions.java +++ b/src/main/java/com/leekwars/generator/FightFunctions.java @@ -123,6 +123,10 @@ public class FightFunctions { new CallableVersion(Type.compound(Type.array(Type.array(Type.INT_OR_REAL)), Type.NULL), new Type[] { Type.INT_OR_NULL }), new CallableVersion(Type.array(Type.array(Type.INT_OR_REAL))), }); + method("getStates", "Entity", 25, true, new CallableVersion[] { + new CallableVersion(Type.compound(Type.array(Type.INT), Type.NULL), new Type[] { Type.INT_OR_NULL }), + new CallableVersion(Type.array(Type.INT)), + }); method("getLevel", "Entity", 15, true, new CallableVersion[] { new CallableVersion(Type.INT_OR_NULL, new Type[] { Type.INT_OR_NULL }), new CallableVersion(Type.INT), @@ -132,7 +136,11 @@ public class FightFunctions { new CallableVersion(Type.INT), }); method("getCores", "Entity", 15, true, new CallableVersion[] { - new CallableVersion(Type.INT, new Type[] { Type.INT }), + new CallableVersion(Type.INT_OR_NULL, new Type[] { Type.INT_OR_NULL }), + new CallableVersion(Type.INT), + }); + method("getRAM", "Entity", 15, true, new CallableVersion[] { + new CallableVersion(Type.INT_OR_NULL, new Type[] { Type.INT_OR_NULL }), new CallableVersion(Type.INT), }); method("getTeamName", "Entity", 15, true, new CallableVersion[] { diff --git a/src/main/java/com/leekwars/generator/Generator.java b/src/main/java/com/leekwars/generator/Generator.java index 9b9291b..86dc65f 100644 --- a/src/main/java/com/leekwars/generator/Generator.java +++ b/src/main/java/com/leekwars/generator/Generator.java @@ -11,6 +11,8 @@ import com.leekwars.generator.chips.Chip; import com.leekwars.generator.chips.ChipType; import com.leekwars.generator.chips.Chips; +import com.leekwars.generator.component.Component; +import com.leekwars.generator.component.Components; import com.leekwars.generator.leek.RegisterManager; import com.leekwars.generator.weapons.Weapon; import com.leekwars.generator.weapons.Weapons; @@ -47,6 +49,7 @@ public Generator() { loadWeapons(); loadChips(); loadSummons(); + loadComponents(); } /** @@ -204,6 +207,7 @@ private void loadChips() { JSONObject chips = JSON.parseObject(Util.readFile("data/chips.json")); for (String id : chips.keySet()) { JSONObject chip = chips.getJSONObject(id); + // System.out.println("New chip " + chip.getString("name") + " " + id + " " + chip.getInteger("template")); Chips.addChip(new Chip(Integer.parseInt(id), chip.getInteger("cost"), chip.getInteger("min_range"), chip.getInteger("max_range"), chip.getJSONArray("effects"), chip.getByte("launch_type"), chip.getByte("area"), chip.getBoolean("los"), chip.getInteger("cooldown"), @@ -231,6 +235,20 @@ private void loadSummons() { } } + private void loadComponents() { + try { + Log.start(TAG, "- Loading components... "); + JSONObject components = JSON.parseObject(Util.readFile("data/components.json")); + for (String id : components.keySet()) { + JSONObject component = components.getJSONObject(id); + Components.addComponent(new Component(Integer.parseInt(id), component.getString("name"), component.getString("stats"), component.getInteger("template"))); + } + Log.end(components.size() + " components loaded."); + } catch (Exception e) { + exception(e); + } + } + public void setCache(boolean cache) { this.use_leekscript_cache = cache; } diff --git a/src/main/java/com/leekwars/generator/Util.java b/src/main/java/com/leekwars/generator/Util.java index 55d55ec..6d377da 100644 --- a/src/main/java/com/leekwars/generator/Util.java +++ b/src/main/java/com/leekwars/generator/Util.java @@ -145,6 +145,7 @@ public void run() { public static void writeFile(String data, String file) { File f = new File(file); + System.out.println("Write file " + f.getAbsolutePath()); try { PrintWriter out = new PrintWriter(f); out.append(data); diff --git a/src/main/java/com/leekwars/generator/action/Actions.java b/src/main/java/com/leekwars/generator/action/Actions.java index 708f103..aa495d4 100644 --- a/src/main/java/com/leekwars/generator/action/Actions.java +++ b/src/main/java/com/leekwars/generator/action/Actions.java @@ -96,9 +96,10 @@ public void addEntity(Entity entity, boolean critical) { object.put("team", entity.getTeam() + 1); object.put("name", entity.getName()); - object.put("cellPos", entity.getCell().getId()); + object.put("cellPos", entity.getCell() != null ? entity.getCell().getId() : null); object.put("farmer", entity.getFarmer()); object.put("type", entity.getType()); + object.put("orientation", entity.getOrientation()); object.put("summon", entity.isSummon()); if (entity.isSummon()) { @@ -116,16 +117,26 @@ public void addMap(Map map) { Cell c = map.getCell(i); if (c != null && !c.isWalkable() && c.getObstacleSize() > 0) { - JSONArray obstacle = new JSONArray(); - obstacle.add(c.getObstacle()); - obstacle.add(c.getObstacleSize()); + if (map.getId() != 0) { + obstacles.put(String.valueOf(c.getId()), c.getObstacle()); + } else { + JSONArray obstacle = new JSONArray(); + obstacle.add(c.getObstacle()); + obstacle.add(c.getObstacleSize()); - obstacles.put(String.valueOf(c.getId()), map.isCustom() ? obstacle : c.getObstacleSize()); + obstacles.put(String.valueOf(c.getId()), map.isCustom() ? obstacle : c.getObstacleSize()); + } } } + if (map.getId() != 0) { + this.map.put("id", map.getId()); + } this.map.put("obstacles", obstacles); this.map.put("type", map.getType()); this.map.put("width", map.getWidth()); this.map.put("height", map.getWidth()); + if (map.getPattern() != null) { + this.map.put("pattern", map.getPattern()); + } } } diff --git a/src/main/java/com/leekwars/generator/area/Area.java b/src/main/java/com/leekwars/generator/area/Area.java index a537a7b..3c6c10e 100644 --- a/src/main/java/com/leekwars/generator/area/Area.java +++ b/src/main/java/com/leekwars/generator/area/Area.java @@ -5,6 +5,7 @@ import com.leekwars.generator.attack.Attack; import com.leekwars.generator.maps.Cell; import com.leekwars.generator.maps.Map; +import com.leekwars.generator.state.Entity; public abstract class Area { @@ -23,6 +24,8 @@ public abstract class Area { public final static int TYPE_SQUARE_1 = 11; public final static int TYPE_SQUARE_2 = 12; public final static int TYPE_FIRST_IN_LINE = 13; + public final static int TYPE_ENEMIES = 14; + public final static int TYPE_ALLIES = 15; protected int mId; protected Attack mAttack; @@ -31,7 +34,7 @@ public Area(Attack attack) { mAttack = attack; } - public abstract List getArea(Map map, Cell launchCell, Cell targetCell); + public abstract List getArea(Map map, Cell launchCell, Cell targetCell, Entity caster); protected boolean isAvailable(Cell c, List cells_to_ignore) { if (c.isWalkable()) @@ -68,6 +71,10 @@ else if (type == Area.TYPE_SQUARE_2) return new AreaSquare2(attack); else if (type == Area.TYPE_FIRST_IN_LINE) return new AreaFirstInLine(attack); + else if (type == Area.TYPE_ALLIES) + return new AreaAllies(attack); + else if (type == Area.TYPE_ENEMIES) + return new AreaEnemies(attack); return null; } } diff --git a/src/main/java/com/leekwars/generator/area/AreaAllies.java b/src/main/java/com/leekwars/generator/area/AreaAllies.java new file mode 100644 index 0000000..98a9c0c --- /dev/null +++ b/src/main/java/com/leekwars/generator/area/AreaAllies.java @@ -0,0 +1,30 @@ +package com.leekwars.generator.area; + +import java.util.ArrayList; +import java.util.List; + +import com.leekwars.generator.attack.Attack; +import com.leekwars.generator.maps.Cell; +import com.leekwars.generator.maps.Map; +import com.leekwars.generator.state.Entity; + +public class AreaAllies extends Area { + + public AreaAllies(Attack attack) { + super(attack); + } + + @Override + public List getArea(Map map, Cell launchCell, Cell targetCell, Entity caster) { + var cells = new ArrayList(); + if (caster != null) { + for (var entity : map.getState().getEntities().values()) { + if (entity.getTeam() == caster.getTeam() && entity.getName().contains("crystal")) continue; + if (entity.getCell() != null && entity.getTeam() == caster.getTeam()) { + cells.add(entity.getCell()); + } + } + } + return cells; + } +} diff --git a/src/main/java/com/leekwars/generator/area/AreaEnemies.java b/src/main/java/com/leekwars/generator/area/AreaEnemies.java new file mode 100644 index 0000000..fa8df7d --- /dev/null +++ b/src/main/java/com/leekwars/generator/area/AreaEnemies.java @@ -0,0 +1,29 @@ +package com.leekwars.generator.area; + +import java.util.ArrayList; +import java.util.List; + +import com.leekwars.generator.attack.Attack; +import com.leekwars.generator.maps.Cell; +import com.leekwars.generator.maps.Map; +import com.leekwars.generator.state.Entity; + +public class AreaEnemies extends Area { + + public AreaEnemies(Attack attack) { + super(attack); + } + + @Override + public List getArea(Map map, Cell launchCell, Cell targetCell, Entity caster) { + var cells = new ArrayList(); + if (caster != null) { + for (var entity : map.getState().getEntities().values()) { + if (entity.getCell() != null && entity.getTeam() != caster.getTeam()) { + cells.add(entity.getCell()); + } + } + } + return cells; + } +} diff --git a/src/main/java/com/leekwars/generator/area/AreaFirstInLine.java b/src/main/java/com/leekwars/generator/area/AreaFirstInLine.java index a4e1008..becdee5 100644 --- a/src/main/java/com/leekwars/generator/area/AreaFirstInLine.java +++ b/src/main/java/com/leekwars/generator/area/AreaFirstInLine.java @@ -7,6 +7,7 @@ import com.leekwars.generator.maps.Cell; import com.leekwars.generator.maps.Map; import com.leekwars.generator.maps.Pathfinding; +import com.leekwars.generator.state.Entity; public class AreaFirstInLine extends Area { @@ -15,7 +16,7 @@ public AreaFirstInLine(Attack attack) { } @Override - public List getArea(Map map, Cell launchCell, Cell targetCell) { + public List getArea(Map map, Cell launchCell, Cell targetCell, Entity caster) { List cells = new ArrayList<>(); Cell cell = map.getFirstEntity(launchCell, targetCell, mAttack.getMinRange(), mAttack.getMaxRange()); if (cell != null) { diff --git a/src/main/java/com/leekwars/generator/area/AreaLaserLine.java b/src/main/java/com/leekwars/generator/area/AreaLaserLine.java index 5212d96..010ab6a 100644 --- a/src/main/java/com/leekwars/generator/area/AreaLaserLine.java +++ b/src/main/java/com/leekwars/generator/area/AreaLaserLine.java @@ -6,6 +6,7 @@ import com.leekwars.generator.attack.Attack; import com.leekwars.generator.maps.Cell; import com.leekwars.generator.maps.Map; +import com.leekwars.generator.state.Entity; public class AreaLaserLine extends Area { @@ -14,7 +15,7 @@ public AreaLaserLine(Attack attack) { } @Override - public List getArea(Map map, Cell launchCell, Cell targetCell) { + public List getArea(Map map, Cell launchCell, Cell targetCell, Entity caster) { ArrayList cells = new ArrayList(); int dx = 0, dy = 0; diff --git a/src/main/java/com/leekwars/generator/area/AreaSingleCell.java b/src/main/java/com/leekwars/generator/area/AreaSingleCell.java index 0ba2950..41e733b 100644 --- a/src/main/java/com/leekwars/generator/area/AreaSingleCell.java +++ b/src/main/java/com/leekwars/generator/area/AreaSingleCell.java @@ -6,6 +6,7 @@ import com.leekwars.generator.attack.Attack; import com.leekwars.generator.maps.Cell; import com.leekwars.generator.maps.Map; +import com.leekwars.generator.state.Entity; public class AreaSingleCell extends Area { @@ -14,7 +15,7 @@ public AreaSingleCell(Attack attack) { } @Override - public List getArea(Map map, Cell launchCell, Cell targetCell) { + public List getArea(Map map, Cell launchCell, Cell targetCell, Entity caster) { ArrayList area = new ArrayList(); area.add(targetCell); return area; diff --git a/src/main/java/com/leekwars/generator/area/MaskArea.java b/src/main/java/com/leekwars/generator/area/MaskArea.java index 0ce1bec..2a2d19c 100644 --- a/src/main/java/com/leekwars/generator/area/MaskArea.java +++ b/src/main/java/com/leekwars/generator/area/MaskArea.java @@ -6,6 +6,7 @@ import com.leekwars.generator.attack.Attack; import com.leekwars.generator.maps.Cell; import com.leekwars.generator.maps.Map; +import com.leekwars.generator.state.Entity; public class MaskArea extends Area { @@ -17,7 +18,7 @@ public MaskArea(Attack attack, int[][] area) { } @Override - public List getArea(Map map, Cell launchCell, Cell targetCell) { + public List getArea(Map map, Cell launchCell, Cell targetCell, Entity caster) { int x = targetCell.getX(), y = targetCell.getY(); ArrayList cells = new ArrayList(); for (int i = 0; i < area.length; i++) { diff --git a/src/main/java/com/leekwars/generator/attack/Attack.java b/src/main/java/com/leekwars/generator/attack/Attack.java index c99cfb1..3a459cc 100644 --- a/src/main/java/com/leekwars/generator/attack/Attack.java +++ b/src/main/java/com/leekwars/generator/attack/Attack.java @@ -7,10 +7,14 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.leekwars.generator.area.Area; +import com.leekwars.generator.area.AreaAllies; +import com.leekwars.generator.area.AreaEnemies; import com.leekwars.generator.area.AreaFirstInLine; import com.leekwars.generator.area.AreaLaserLine; +import com.leekwars.generator.chips.Chip; import com.leekwars.generator.effect.Effect; import com.leekwars.generator.effect.EffectParameters; +import com.leekwars.generator.items.Item; import com.leekwars.generator.leek.Leek; import com.leekwars.generator.maps.Cell; import com.leekwars.generator.maps.Map; @@ -54,6 +58,7 @@ public class Attack { private int dammageAttack = 0; private final int attackType; private final int itemID; + private Item item; private final int areaID; private final List effects = new ArrayList(); @@ -94,12 +99,12 @@ public int getArea() { public List getTargetCells(Map map, Leek caster, Cell target) { // On récupère les cases cibles - return area.getArea(map, caster.getCell(), target); + return area.getArea(map, caster.getCell(), target, caster); } public List getTargetCells(Map map, Cell cast_cell, Cell target) { // On récupère les cases cibles - return area.getArea(map, cast_cell, target); + return area.getArea(map, cast_cell, target, null); } public List getWeaponTargets(State state, Entity caster, Cell target) { @@ -110,7 +115,7 @@ public List getWeaponTargets(State state, Entity caster, Cell target) { // launchType) a été vérifiée avant l'appel // On récupère les cases cibles - List targetCells = area.getArea(state.getMap(), caster.getCell(), target); + List targetCells = area.getArea(state.getMap(), caster.getCell(), target, caster); // On trouve les poireaux sur ces cellules List targetEntities = new ArrayList(); @@ -150,7 +155,7 @@ public List applyOnCell(State state, Entity caster, Cell target, boolean List returnEntities = new ArrayList(); // On récupère les cases cibles - List targetCells = area.getArea(state.getMap(), caster.getCell(), target); + List targetCells = area.getArea(state.getMap(), caster.getCell(), target, caster); // On trouve les poireaux sur ces cellules List targetEntities = new ArrayList(); @@ -282,7 +287,7 @@ private boolean filterTarget(int targets, Entity caster, Entity target) { // Compute the area effect attenuation : 100% at center, 50% on the border public double getPowerForCell(Cell target_cell, Cell current_cell) { - if (area instanceof AreaLaserLine || area instanceof AreaFirstInLine) { + if (area instanceof AreaLaserLine || area instanceof AreaFirstInLine || area instanceof AreaAllies || area instanceof AreaEnemies) { return 1.0; } @@ -342,4 +347,12 @@ public boolean needsEmptyCell() { } return false; } + + public void setItem(Item item) { + this.item = item; + } + + public Item getItem() { + return item; + } } diff --git a/src/main/java/com/leekwars/generator/attack/EntityState.java b/src/main/java/com/leekwars/generator/attack/EntityState.java index eff8f32..aca3383 100644 --- a/src/main/java/com/leekwars/generator/attack/EntityState.java +++ b/src/main/java/com/leekwars/generator/attack/EntityState.java @@ -4,7 +4,7 @@ public enum EntityState { NONE, // 0 RESURRECTED, // 1 UNHEALABLE, // 2 - INVICIBLE, // 3 + INVINCIBLE, // 3 PACIFIST, // 4 HEAVY, // 5 DENSE, // 6 diff --git a/src/main/java/com/leekwars/generator/bulbs/BulbTemplate.java b/src/main/java/com/leekwars/generator/bulbs/BulbTemplate.java index da249db..fa135db 100644 --- a/src/main/java/com/leekwars/generator/bulbs/BulbTemplate.java +++ b/src/main/java/com/leekwars/generator/bulbs/BulbTemplate.java @@ -113,6 +113,8 @@ public Bulb createInvocation(Entity owner, int id, int level, boolean critical) base(mMinResistance, mMaxResistance, c, multiplier), base(mMinScience, mMaxScience, c, multiplier), base(mMinMagic, mMaxMagic, c, multiplier), + 1, + 6, base(mMinTp, mMaxTp, c, multiplier), base(mMinMp, mMaxMp, c, multiplier), mId, 0); diff --git a/src/main/java/com/leekwars/generator/chips/Chip.java b/src/main/java/com/leekwars/generator/chips/Chip.java index eab4a43..173dc88 100644 --- a/src/main/java/com/leekwars/generator/chips/Chip.java +++ b/src/main/java/com/leekwars/generator/chips/Chip.java @@ -14,6 +14,7 @@ public class Chip extends Item { public Chip(int id, int cost, int minRange, int maxRange, JSONArray effects, byte launchType, byte area, boolean los, int cooldown, boolean teamCooldown, int initialCooldown, int level, int template, String name, ChipType chipType) { super(id, cost, name, template, new Attack(minRange, maxRange, launchType, area, los, effects, Attack.TYPE_CHIP, id)); + this.attack.setItem(this); this.cooldown = cooldown; this.teamCooldown = teamCooldown; diff --git a/src/main/java/com/leekwars/generator/classes/ChipClass.java b/src/main/java/com/leekwars/generator/classes/ChipClass.java index ce98c51..3e27128 100644 --- a/src/main/java/com/leekwars/generator/classes/ChipClass.java +++ b/src/main/java/com/leekwars/generator/classes/ChipClass.java @@ -285,7 +285,9 @@ public static long resurrect(EntityAI ai, long entity, long cell) throws LeekRun } Chip template = ai.getEntity().getChip(FightConstants.CHIP_RESURRECTION.getIntValue()); - if (template == null) { + Chip template2 = ai.getEntity().getChip(415); + boolean fullLife = template2 != null; + if (template == null && template2 == null) { Chip ct = Chips.getChip(FightConstants.CHIP_RESURRECTION.getIntValue()); @@ -296,8 +298,8 @@ public static long resurrect(EntityAI ai, long entity, long cell) throws LeekRun return -1; } - if (target != null && template != null) { - success = ai.getState().resurrectEntity(ai.getEntity(), target, template, l); + if (target != null && (template != null || template2 != null)) { + success = ai.getState().resurrectEntity(ai.getEntity(), target, template != null ? template : template2, l, fullLife); } return success; } diff --git a/src/main/java/com/leekwars/generator/classes/EntityClass.java b/src/main/java/com/leekwars/generator/classes/EntityClass.java index ee99942..4249718 100644 --- a/src/main/java/com/leekwars/generator/classes/EntityClass.java +++ b/src/main/java/com/leekwars/generator/classes/EntityClass.java @@ -200,13 +200,34 @@ public static Long getFrequency(EntityAI ai, Object value) { return null; } - // Deprecated function in LeekScript public static long getCores(EntityAI ai) { - return 0l; + return ai.getEntity().getCores(); } - public static long getCores(EntityAI ai, long value) { - return 0l; + public static Long getCores(EntityAI ai, Object value) { + if (value == null) + return (long) ai.getEntity().getCores(); + if (value instanceof Number) { + var l = ai.getFight().getEntity(((Number) value).intValue()); + if (l != null) + return (long) l.getCores(); + } + return null; + } + + public static long getRAM(EntityAI ai) { + return ai.getEntity().getRAM(); + } + + public static Long getRAM(EntityAI ai, Object value) { + if (value == null) + return (long) ai.getEntity().getRAM(); + if (value instanceof Number) { + var l = ai.getFight().getEntity(((Number) value).intValue()); + if (l != null) + return (long) l.getRAM(); + } + return null; } public static Long getCell(EntityAI ai) throws LeekRunException { diff --git a/src/main/java/com/leekwars/generator/classes/NetworkClass.java b/src/main/java/com/leekwars/generator/classes/NetworkClass.java index 3e84073..cfc625f 100644 --- a/src/main/java/com/leekwars/generator/classes/NetworkClass.java +++ b/src/main/java/com/leekwars/generator/classes/NetworkClass.java @@ -2,6 +2,7 @@ import com.leekwars.generator.fight.entity.EntityAI; import com.leekwars.generator.fight.entity.EntityAI.LeekMessage; +import com.leekwars.generator.state.Entity; import leekscript.runner.LeekRunException; import leekscript.runner.values.ArrayLeekValue; @@ -87,6 +88,10 @@ public static ArrayLeekValue getMessages(EntityAI ai, long target_leek) throws L EntityAI lia = (EntityAI) l.getAI(); var messages = new ArrayLeekValue(ai); + if (l.getType() == Entity.TYPE_MOB && l != ai.getEntity()) { + return messages; + } + // On y ajoute les messages if (lia != null) { diff --git a/src/main/java/com/leekwars/generator/component/Component.java b/src/main/java/com/leekwars/generator/component/Component.java new file mode 100644 index 0000000..8784859 --- /dev/null +++ b/src/main/java/com/leekwars/generator/component/Component.java @@ -0,0 +1,37 @@ +package com.leekwars.generator.component; + +import java.util.HashMap; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; + +public class Component { + + private final int id; + private final String name; + private final HashMap stats = new HashMap<>(); + private final int template; + + public Component(int id, String name, String stats, int template) { + this.id = id; + this.name = name; + for (var stat : JSON.parseArray(stats)) { + this.stats.put(((JSONArray) stat).getString(0), ((JSONArray) stat).getInteger(1)); + } + // System.out.println(this.stats); + this.template = template; + } + + public int getId() { + return id; + } + public int getTemplate() { + return template; + } + public HashMap getStats() { + return stats; + } + public String getName() { + return name; + } +} diff --git a/src/main/java/com/leekwars/generator/component/Components.java b/src/main/java/com/leekwars/generator/component/Components.java new file mode 100644 index 0000000..0c985bc --- /dev/null +++ b/src/main/java/com/leekwars/generator/component/Components.java @@ -0,0 +1,24 @@ +package com.leekwars.generator.component; + +import java.util.Map; +import java.util.TreeMap; + +import com.leekwars.generator.items.Items; + +public class Components { + + private static Map components = new TreeMap(); + + public static void addComponent(Component component) { + components.put(component.getTemplate(), component); + Items.addComponent(component.getTemplate()); + } + + public static Component getComponent(int id) { + return components.get(id); + } + + public static Map getTemplates() { + return components; + } +} diff --git a/src/main/java/com/leekwars/generator/effect/Effect.java b/src/main/java/com/leekwars/generator/effect/Effect.java index 0f537ef..a9ab03e 100644 --- a/src/main/java/com/leekwars/generator/effect/Effect.java +++ b/src/main/java/com/leekwars/generator/effect/Effect.java @@ -5,6 +5,8 @@ import com.leekwars.generator.action.ActionAddEffect; import com.leekwars.generator.action.ActionStackEffect; import com.leekwars.generator.attack.Attack; +import com.leekwars.generator.attack.EntityState; +import com.leekwars.generator.items.Item; import com.leekwars.generator.state.Entity; import com.leekwars.generator.state.State; import com.leekwars.generator.state.Stats; @@ -172,6 +174,7 @@ public abstract class Effect implements Cloneable { public int targetCount; public int propagate = 0; // Distance de propagation public int modifiers = 0; + protected EntityState state; public static int createEffect(State state, int id, int turns, double aoe, double value1, double value2, boolean critical, Entity target, Entity caster, Attack attack, double jet, boolean stackable, int previousEffectTotalValue, int targetCount, int propagate, int modifiers) { @@ -385,4 +388,12 @@ public void setTarget(Entity entity) { public void setCaster(Entity entity) { this.caster = entity; } + + public Item getItem() { + return this.attack != null ? this.attack.getItem() : null; + } + + public EntityState getState() { + return state; + } } diff --git a/src/main/java/com/leekwars/generator/effect/EffectAddState.java b/src/main/java/com/leekwars/generator/effect/EffectAddState.java index 7dfd162..b337303 100644 --- a/src/main/java/com/leekwars/generator/effect/EffectAddState.java +++ b/src/main/java/com/leekwars/generator/effect/EffectAddState.java @@ -5,9 +5,12 @@ public class EffectAddState extends Effect { + @Override public void apply(State state) { - target.addState(EntityState.values()[(int) value1]); + value = 1; + this.state = EntityState.values()[(int) value1]; + target.addState(this.state); } } \ No newline at end of file diff --git a/src/main/java/com/leekwars/generator/effect/EffectAftereffect.java b/src/main/java/com/leekwars/generator/effect/EffectAftereffect.java index c7564c1..db90e0e 100644 --- a/src/main/java/com/leekwars/generator/effect/EffectAftereffect.java +++ b/src/main/java/com/leekwars/generator/effect/EffectAftereffect.java @@ -2,6 +2,7 @@ import com.leekwars.generator.action.ActionDamage; import com.leekwars.generator.attack.DamageType; +import com.leekwars.generator.attack.EntityState; import com.leekwars.generator.state.State; public class EffectAftereffect extends Effect { @@ -12,13 +13,17 @@ public void apply(State state) { value = (int) Math.round((value1 + value2 * jet) * (1 + (double) caster.getScience() / 100) * aoe * criticalPower); value = Math.max(0, value); + if (target.hasState(EntityState.INVINCIBLE)) { + value = 0; + } + if (target.getLife() < value) { value = target.getLife(); } int erosion = (int) Math.round(value * erosionRate); state.log(new ActionDamage(DamageType.AFTEREFFECT, target, value, erosion)); - target.removeLife(value, erosion, caster, DamageType.AFTEREFFECT, this); + target.removeLife(value, erosion, caster, DamageType.AFTEREFFECT, this, getItem()); } @Override @@ -30,6 +35,6 @@ public void applyStartTurn(State state) { int erosion = (int) Math.round(value * erosionRate); state.log(new ActionDamage(DamageType.AFTEREFFECT, target, value, erosion)); - target.removeLife(value, erosion, caster, DamageType.AFTEREFFECT, this); + target.removeLife(value, erosion, caster, DamageType.AFTEREFFECT, this, getItem()); } } diff --git a/src/main/java/com/leekwars/generator/effect/EffectDamage.java b/src/main/java/com/leekwars/generator/effect/EffectDamage.java index be17ff3..2419d4a 100644 --- a/src/main/java/com/leekwars/generator/effect/EffectDamage.java +++ b/src/main/java/com/leekwars/generator/effect/EffectDamage.java @@ -26,6 +26,10 @@ public void apply(State state) { d -= d * (target.getRelativeShield() / 100.0) + target.getAbsoluteShield(); d = Math.max(0, d); + if (target.hasState(EntityState.INVINCIBLE)) { + d = 0; + } + value = (int) Math.round(d); if (target.getLife() < value) { @@ -40,7 +44,7 @@ public void apply(State state) { int erosion = (int) Math.round(value * erosionRate); state.log(new ActionDamage(DamageType.DIRECT, target, value, erosion)); - target.removeLife(value, erosion, caster, DamageType.DIRECT, this); + target.removeLife(value, erosion, caster, DamageType.DIRECT, this, getItem()); target.onDirectDamage(value); target.onNovaDamage(erosion); @@ -57,7 +61,7 @@ public void apply(State state) { } // Return damage - if (returnDamage > 0) { + if (returnDamage > 0 && !caster.hasState(EntityState.INVINCIBLE)) { if (caster.getLife() < returnDamage) { returnDamage = caster.getLife(); @@ -67,7 +71,7 @@ public void apply(State state) { if (returnDamage > 0) { state.log(new ActionDamage(DamageType.RETURN, caster, returnDamage, returnErosion)); - caster.removeLife(returnDamage, returnErosion, target, DamageType.RETURN, this); + caster.removeLife(returnDamage, returnErosion, target, DamageType.RETURN, this, getItem()); caster.onNovaDamage(returnErosion); } } diff --git a/src/main/java/com/leekwars/generator/effect/EffectKill.java b/src/main/java/com/leekwars/generator/effect/EffectKill.java index 42bdad2..e434c36 100644 --- a/src/main/java/com/leekwars/generator/effect/EffectKill.java +++ b/src/main/java/com/leekwars/generator/effect/EffectKill.java @@ -9,8 +9,11 @@ public class EffectKill extends Effect { @Override public void apply(State state) { - value = target.getLife(); - state.log(new ActionKill(caster, target)); - target.removeLife(value, 0, caster, DamageType.DIRECT, this); + // if (!target.hasState(EntityState.INVINCIBLE)) { // Graal + + value = target.getLife(); + state.log(new ActionKill(caster, target)); + target.removeLife(value, 0, caster, DamageType.DIRECT, this, getItem()); + // } } } diff --git a/src/main/java/com/leekwars/generator/effect/EffectLifeDamage.java b/src/main/java/com/leekwars/generator/effect/EffectLifeDamage.java index a8ab39d..c0104e4 100644 --- a/src/main/java/com/leekwars/generator/effect/EffectLifeDamage.java +++ b/src/main/java/com/leekwars/generator/effect/EffectLifeDamage.java @@ -2,6 +2,7 @@ import com.leekwars.generator.action.ActionDamage; import com.leekwars.generator.attack.DamageType; +import com.leekwars.generator.attack.EntityState; import com.leekwars.generator.state.State; public class EffectLifeDamage extends Effect { @@ -14,6 +15,10 @@ public void apply(State state) { // Base damages double d = ((value1 + jet * value2) / 100) * caster.getLife() * aoe * criticalPower * (1 + caster.getPower() / 100.0); + if (target.hasState(EntityState.INVINCIBLE)) { + d = 0; + } + // Return damage if (target != caster) { returnDamage = (int) Math.round(d * target.getDamageReturn() / 100.0); @@ -32,12 +37,12 @@ public void apply(State state) { int erosion = (int) Math.round(value * erosionRate); state.log(new ActionDamage(DamageType.LIFE, target, value, erosion)); - target.removeLife(value, erosion, caster, DamageType.LIFE, this); + target.removeLife(value, erosion, caster, DamageType.LIFE, this, getItem()); target.onDirectDamage(value); target.onNovaDamage(erosion); // Return damage - if (returnDamage > 0) { + if (returnDamage > 0 && !caster.hasState(EntityState.INVINCIBLE)) { if (caster.getLife() < returnDamage) { returnDamage = caster.getLife(); @@ -47,7 +52,7 @@ public void apply(State state) { if (returnDamage > 0) { state.log(new ActionDamage(DamageType.RETURN, caster, returnDamage, returnErosion)); - caster.removeLife(returnDamage, returnErosion, target, DamageType.RETURN, this); + caster.removeLife(returnDamage, returnErosion, target, DamageType.RETURN, this, getItem()); } } } diff --git a/src/main/java/com/leekwars/generator/effect/EffectNovaDamage.java b/src/main/java/com/leekwars/generator/effect/EffectNovaDamage.java index 41e5f12..2726cda 100644 --- a/src/main/java/com/leekwars/generator/effect/EffectNovaDamage.java +++ b/src/main/java/com/leekwars/generator/effect/EffectNovaDamage.java @@ -2,6 +2,7 @@ import com.leekwars.generator.action.ActionDamage; import com.leekwars.generator.attack.DamageType; +import com.leekwars.generator.attack.EntityState; import com.leekwars.generator.state.State; public class EffectNovaDamage extends Effect { @@ -12,6 +13,10 @@ public void apply(State state) { // Base damages double d = (value1 + jet * value2) * (1 + Math.max(0, caster.getScience()) / 100.0) * aoe * criticalPower * (1 + caster.getPower() / 100.0); + if (target.hasState(EntityState.INVINCIBLE)) { + d = 0; + } + value = (int) Math.round(d); if (value > target.getTotalLife() - target.getLife()) { @@ -19,7 +24,7 @@ public void apply(State state) { } state.log(new ActionDamage(DamageType.NOVA, target, value, 0)); - target.removeLife(0, value, caster, DamageType.NOVA, this); + target.removeLife(0, value, caster, DamageType.NOVA, this, getItem()); target.onNovaDamage(value); } } diff --git a/src/main/java/com/leekwars/generator/effect/EffectPoison.java b/src/main/java/com/leekwars/generator/effect/EffectPoison.java index fdb05b8..a2dd57d 100644 --- a/src/main/java/com/leekwars/generator/effect/EffectPoison.java +++ b/src/main/java/com/leekwars/generator/effect/EffectPoison.java @@ -2,6 +2,7 @@ import com.leekwars.generator.action.ActionDamage; import com.leekwars.generator.attack.DamageType; +import com.leekwars.generator.attack.EntityState; import com.leekwars.generator.state.State; public class EffectPoison extends Effect { @@ -18,11 +19,16 @@ public void applyStartTurn(State state) { if (target.getLife() < damages) { damages = target.getLife(); } + + if (target.hasState(EntityState.INVINCIBLE)) { + damages = 0; + } + if (damages > 0) { int erosion = (int) Math.round(damages * erosionRate); state.log(new ActionDamage(DamageType.POISON, target, damages, erosion)); - target.removeLife(damages, erosion, caster, DamageType.POISON, this); + target.removeLife(damages, erosion, caster, DamageType.POISON, this, getItem()); target.onPoisonDamage(damages); target.onNovaDamage(erosion); } diff --git a/src/main/java/com/leekwars/generator/entity/Bulb.java b/src/main/java/com/leekwars/generator/entity/Bulb.java index 7ad7902..95f903e 100644 --- a/src/main/java/com/leekwars/generator/entity/Bulb.java +++ b/src/main/java/com/leekwars/generator/entity/Bulb.java @@ -10,8 +10,8 @@ public class Bulb extends Entity { protected Entity mOwner; - public Bulb(Entity owner, Integer id, String name, int level, int life, int strength, int wisdom, int agility, int resistance, int science, int magic, int tp, int mp, int skin, int hat) { - super(id, name, owner.getFarmer(), level, life, tp, mp, strength, agility, 0, wisdom, resistance, science, magic, skin, false, 0, owner.getTeamId(), owner.getTeamName(), owner.getAIId(), owner.getAIName(), owner.getFarmerName(), owner.getFarmerCountry(), hat); + public Bulb(Entity owner, Integer id, String name, int level, int life, int strength, int wisdom, int agility, int resistance, int science, int magic, int cores, int ram, int tp, int mp, int skin, int hat) { + super(id, name, owner.getFarmer(), level, life, tp, mp, strength, agility, 0, wisdom, resistance, science, magic, cores, ram, skin, false, 0, owner.getTeamId(), owner.getTeamName(), owner.getAIId(), owner.getAIName(), owner.getFarmerName(), owner.getFarmerCountry(), hat); mOwner = owner; state = mOwner.state; @@ -33,8 +33,8 @@ public int getType() { } @Override - public void resurrect(Entity entity, double factor) { - super.resurrect(entity, factor); + public void resurrect(Entity entity, double factor, boolean fullLife) { + super.resurrect(entity, factor, fullLife); mOwner = entity; } diff --git a/src/main/java/com/leekwars/generator/fight/Fight.java b/src/main/java/com/leekwars/generator/fight/Fight.java index 693704b..3cacc8e 100644 --- a/src/main/java/com/leekwars/generator/fight/Fight.java +++ b/src/main/java/com/leekwars/generator/fight/Fight.java @@ -59,6 +59,7 @@ public class Fight { public final static int TYPE_FARMER = 1; public final static int TYPE_TEAM = 2; public final static int TYPE_BATTLE_ROYALE = 3; + public final static int TYPE_BOSS = 4; // Flags public final static int FLAG_STATIC = 1; @@ -141,6 +142,10 @@ public List getTeamLeeks(int team) { return leeks; } + public List getTeamEntities(int team) { + return state.getTeams().get(team).getEntities(); + } + public Entity getEntity(int id) { return state.getEntity(id); } diff --git a/src/main/java/com/leekwars/generator/fight/entity/EntityAI.java b/src/main/java/com/leekwars/generator/fight/entity/EntityAI.java index 6b32a7d..4c1dd15 100644 --- a/src/main/java/com/leekwars/generator/fight/entity/EntityAI.java +++ b/src/main/java/com/leekwars/generator/fight/entity/EntityAI.java @@ -85,6 +85,7 @@ public GenericArrayLeekValue getArray(EntityAI ai) throws LeekRunException { protected boolean valid = false; private boolean isFirstRuntimeError = true; + private boolean staticInitialized = false; public EntityAI(int instructions, int version) { super(instructions, version); @@ -143,6 +144,9 @@ public static EntityAI build(Generator generator, AIFile file, Entity entity) { ai.valid = true; ai.setEntity(entity); ai.setLogs((LeekLog) entity.getLogs()); + // System.out.println("Coeurs = " + entity.getCores() + " RAM = " + entity.getRAM()); + ai.setMaxRAM(Math.min(50, entity.getRAM()) * 8_000_000); + ai.setMaxOperations(entity.getCores() * 1_000_000); return ai; } catch (LeekScriptException e) { @@ -260,8 +264,9 @@ public void runTurn(int turn) { try { mEntity = mInitialEntity; - if (turn == 1) { + if (!staticInitialized) { staticInit(); + staticInitialized = true; } runIA(); diff --git a/src/main/java/com/leekwars/generator/items/Items.java b/src/main/java/com/leekwars/generator/items/Items.java index 17ab39c..6fd327f 100644 --- a/src/main/java/com/leekwars/generator/items/Items.java +++ b/src/main/java/com/leekwars/generator/items/Items.java @@ -7,6 +7,7 @@ public class Items { public final static int TYPE_WEAPON = 1; public final static int TYPE_CHIP = 2; public final static int TYPE_POTION = 3; + public final static int TYPE_COMPONENT = 8; private static TreeMap items = new TreeMap(); @@ -16,6 +17,9 @@ public static void addWeapon(int id) { public static void addChip(int id) { items.put(id, TYPE_CHIP); } + public static void addComponent(int id) { + items.put(id, TYPE_COMPONENT); + } public static Integer getType(int item) { return items.get(item); diff --git a/src/main/java/com/leekwars/generator/leek/Leek.java b/src/main/java/com/leekwars/generator/leek/Leek.java index 40a59c8..9a507b6 100644 --- a/src/main/java/com/leekwars/generator/leek/Leek.java +++ b/src/main/java/com/leekwars/generator/leek/Leek.java @@ -6,8 +6,8 @@ public class Leek extends Entity { public Leek() {} - public Leek(Integer id, String name, int farmer, int level, int life, int turn_point, int move_point, int force, int agility, int frequency, int wisdom, int resistance, int science, int magic, int skin, boolean metal, int face, int team_id, String team_name, int ai_id, String ai_name, String farmer_name, String farmer_country, int hat) { - super(id, name, farmer, level, life, turn_point, move_point, force, agility, frequency, wisdom, resistance, science, magic, skin, metal, face, team_id, team_name, ai_id, ai_name, farmer_name, farmer_country, hat); + public Leek(Integer id, String name, int farmer, int level, int life, int turn_point, int move_point, int force, int agility, int frequency, int wisdom, int resistance, int science, int magic, int cores, int ram, int skin, boolean metal, int face, int team_id, String team_name, int ai_id, String ai_name, String farmer_name, String farmer_country, int hat) { + super(id, name, farmer, level, life, turn_point, move_point, force, agility, frequency, wisdom, resistance, science, magic, cores, ram, skin, metal, face, team_id, team_name, ai_id, ai_name, farmer_name, farmer_country, hat); } public Leek(Integer id, String name) { diff --git a/src/main/java/com/leekwars/generator/maps/Map.java b/src/main/java/com/leekwars/generator/maps/Map.java index 1524b9c..0e0eae7 100644 --- a/src/main/java/com/leekwars/generator/maps/Map.java +++ b/src/main/java/com/leekwars/generator/maps/Map.java @@ -30,6 +30,8 @@ import com.leekwars.generator.state.State; import com.leekwars.generator.state.Team; +import leekscript.ErrorManager; + public class Map { public final static byte NORTH = 0;// NE @@ -39,6 +41,7 @@ public class Map { private final static boolean DEBUG = false; + private final int id; private final List cells; private final int height; private final int width; @@ -53,6 +56,8 @@ public class Map { private JSONObject custom_map; private HashMap cellByEntity = new HashMap<>(); private HashMap entityByCell = new HashMap<>(); + private JSONArray pattern; + private State state; public static Map generateMap(State state, int context, int width, int height, int obstacles_count, List teams, JSONObject custom_map) { @@ -62,8 +67,10 @@ public static Map generateMap(State state, int context, int width, int height, i if (custom_map != null) { - map = new Map(width, height); + map = new Map(width, height, custom_map.getIntValue("id")); map.custom_map = custom_map; + map.pattern = custom_map.getJSONArray("pattern"); + map.state = state; JSONObject obstacles = custom_map.getJSONObject("obstacles"); JSONArray team1 = custom_map.getJSONArray("team1"); @@ -73,21 +80,26 @@ public static Map generateMap(State state, int context, int width, int height, i for (int t = 0; t < teams.size(); ++t) { int pos = 0; for (Entity l : teams.get(t).getEntities()) { + if (l.isDead()) continue; // Random cell Cell c; - if (teams.size() == 2) { // 2 teams : 2 sides - c = map.getRandomCell(state, t == 0 ? 1 : 4); - } else { // 2+ teams : random - c = map.getRandomCell(state); - } - // User custom cell? - if (t < 2) { - JSONArray team = t == 0 ? team1 : team2; - if (team != null) { - if (pos < team.size()) { - int cell_id = team.getIntValue(pos++); - if (cell_id >= 0 || cell_id < map.nb_cells) { - c = map.getCell(cell_id); + if (map.id != 0 && l.getInitialCell() != null) { + c = map.getCell(l.getInitialCell()); + } else { + if (teams.size() == 2) { // 2 teams : 2 sides + c = map.getRandomCell(state, t == 0 ? 1 : 4); + } else { // 2+ teams : random + c = map.getRandomCell(state); + } + // User custom cell? + if (t < 2) { + JSONArray team = t == 0 ? team1 : team2; + if (team != null) { + if (pos < team.size()) { + int cell_id = team.getIntValue(pos++); + if (cell_id >= 0 || cell_id < map.nb_cells) { + c = map.getCell(cell_id); + } } } } @@ -102,10 +114,46 @@ public static Map generateMap(State state, int context, int width, int height, i int cell_id = Integer.parseInt(c.getKey()); Cell cell = map.getCell(cell_id); if (cell.available(map)) { - int id = c.getValue() instanceof Boolean ? 1 : (Integer) c.getValue(); - cell.setObstacle(id, 1); + if (c.getValue() instanceof Boolean) { + cell.setObstacle(1, 1); + } else { + int id = (Integer) c.getValue(); + ObstacleInfo info = ObstacleInfo.get(id); + if (info.size == 1) { + cell.setObstacle(id, info.size); + } else if (info.size == 2) { + cell.setObstacle(id, info.size); + Cell c2 = map.getCellByDir(cell, Pathfinding.EAST); + Cell c3 = map.getCellByDir(cell, Pathfinding.SOUTH); + Cell c4 = map.getCellByDir(c3, Pathfinding.EAST); + c2.setObstacle(0, -1); + c3.setObstacle(0, -2); + c4.setObstacle(0, -3); + } else if (info.size == 3) { + cell.setObstacle(id, info.size); + for (int x = -1; x <= 1; ++x) { + for (int y = -1; y <= 1; ++y) { + if (x != 0 || y != 0) + map.getNextCell(cell, x, y).setObstacle(0, -1); + } + } + } else if (info.size == 4) { + cell.setObstacle(id, info.size); + map.getNextCell(cell, -3, 0).setObstacle(0, -1); + } else if (info.size == 5) { + cell.setObstacle(id, info.size); + // [[0, -1], [0, 0], [0, 3], [2, -1], [2, 0], [2, 3]] + map.getNextCell(cell, 0, -1).setObstacle(0, -1); + map.getNextCell(cell, 0, 3).setObstacle(0, -1); + map.getNextCell(cell, 2, -1).setObstacle(0, -1); + map.getNextCell(cell, 2, 0).setObstacle(0, -1); + map.getNextCell(cell, 2, 3).setObstacle(0, -1); + } + } } - } catch (Exception e) {} + } catch (Exception e) { + ErrorManager.exception(e); + } } map.computeComposantes(); @@ -114,6 +162,7 @@ public static Map generateMap(State state, int context, int width, int height, i while (!valid && nb < 63) { map = new Map(width, height); + map.state = state; for (int i = 0; i < obstacles_count; i++) { Cell c = map.getCell(state.getRandom().getInt(0, map.getNbCell())); @@ -191,15 +240,22 @@ public static Map generateMap(State state, int context, int width, int height, i map.setType(-1); // Nexus } else if (context == State.CONTEXT_TOURNAMENT) { map.setType(5); // Arena + } else if (custom_map != null && custom_map.containsKey("type")) { + map.setType(custom_map.getIntValue("type")); } // map.drawMap(); return map; } public Map(int width, int height) { + this(width, height, 0); + } + + public Map(int width, int height, int id) { this.width = width; this.height = height; + this.id = id; nb_cells = (width * 2 - 1) * height - (width - 1); @@ -227,6 +283,7 @@ public Map(int width, int height) { } public Map(Map map, State state) { + this.id = map.id; this.width = map.width; this.height = map.height; this.nb_cells = map.nb_cells; @@ -1119,6 +1176,9 @@ public boolean canUseAttack(Cell caster, Cell target, Attack attack) { return false; } // Ligne de vue + if (attack.getItemId() == 415) { + return true; + } return verifyLoS(caster, target, attack, caster); } @@ -1197,5 +1257,15 @@ public static int getDistance2(Cell c1, Cell c2) { return (c1.getX() - c2.getX()) * (c1.getX() - c2.getX()) + (c1.getY() - c2.getY()) * (c1.getY() - c2.getY()); } + public int getId() { + return id; + } + public JSONArray getPattern() { + return pattern; + } + + public State getState() { + return state; + } } diff --git a/src/main/java/com/leekwars/generator/maps/ObstacleInfo.java b/src/main/java/com/leekwars/generator/maps/ObstacleInfo.java new file mode 100644 index 0000000..5784cda --- /dev/null +++ b/src/main/java/com/leekwars/generator/maps/ObstacleInfo.java @@ -0,0 +1,62 @@ +package com.leekwars.generator.maps; + +import java.util.HashMap; + +public class ObstacleInfo { + + private static HashMap obstacles = new HashMap<>(); + + public int size; + + static { + obstacles.put(5, new ObstacleInfo(1)); + obstacles.put(20, new ObstacleInfo(1)); + obstacles.put(21, new ObstacleInfo(1)); + obstacles.put(22, new ObstacleInfo(1)); + obstacles.put(38, new ObstacleInfo(1)); + obstacles.put(40, new ObstacleInfo(1)); + obstacles.put(41, new ObstacleInfo(1)); + obstacles.put(42, new ObstacleInfo(1)); + obstacles.put(48, new ObstacleInfo(1)); + obstacles.put(50, new ObstacleInfo(1)); + obstacles.put(63, new ObstacleInfo(1)); + obstacles.put(66, new ObstacleInfo(1)); + obstacles.put(53, new ObstacleInfo(1)); + obstacles.put(55, new ObstacleInfo(1)); + obstacles.put(57, new ObstacleInfo(1)); + obstacles.put(59, new ObstacleInfo(1)); + obstacles.put(62, new ObstacleInfo(1)); + + obstacles.put(11, new ObstacleInfo(2)); + obstacles.put(17, new ObstacleInfo(2)); + obstacles.put(18, new ObstacleInfo(2)); + obstacles.put(34, new ObstacleInfo(2)); + obstacles.put(43, new ObstacleInfo(2)); + obstacles.put(44, new ObstacleInfo(2)); + obstacles.put(45, new ObstacleInfo(2)); + obstacles.put(46, new ObstacleInfo(2)); + obstacles.put(47, new ObstacleInfo(2)); + obstacles.put(49, new ObstacleInfo(2)); + obstacles.put(64, new ObstacleInfo(2)); + obstacles.put(65, new ObstacleInfo(2)); + obstacles.put(52, new ObstacleInfo(2)); + obstacles.put(54, new ObstacleInfo(2)); + obstacles.put(56, new ObstacleInfo(2)); + obstacles.put(58, new ObstacleInfo(2)); + obstacles.put(61, new ObstacleInfo(2)); + + obstacles.put(51, new ObstacleInfo(3)); + + obstacles.put(39, new ObstacleInfo(4)); + + obstacles.put(60, new ObstacleInfo(5)); + } + + public ObstacleInfo(int size) { + this.size = size; + } + + public static ObstacleInfo get(int id) { + return obstacles.get(id); + } +} diff --git a/src/main/java/com/leekwars/generator/scenario/EntityInfo.java b/src/main/java/com/leekwars/generator/scenario/EntityInfo.java index 2da334a..d351fc8 100644 --- a/src/main/java/com/leekwars/generator/scenario/EntityInfo.java +++ b/src/main/java/com/leekwars/generator/scenario/EntityInfo.java @@ -37,6 +37,7 @@ public class EntityInfo { public int farmer; public int team; public int level; + public boolean dead; public int life; public int tp; public int mp; @@ -47,15 +48,18 @@ public class EntityInfo { public int resistance; public int science; public int magic; + public int cores; + public int ram; public List chips = new ArrayList(); public List weapons = new ArrayList(); - public int cell; + public Integer cell; public boolean static_; public int skin; public int hat; public boolean metal; public int face; public Class customClass; + public int orientation; public EntityInfo() { } @@ -80,6 +84,8 @@ public EntityInfo(JSONObject e) { resistance = e.getIntValue("resistance"); science = e.getIntValue("science"); magic = e.getIntValue("magic"); + cores = e.getIntValue("cores"); + ram = e.getIntValue("ram"); static_ = e.getBooleanValue("static"); JSONArray weapons = e.getJSONArray("weapons"); @@ -120,10 +126,14 @@ public Entity createEntity(Generator generator, Scenario scenario, Fight fight) entity.setScience(science); entity.setMagic(magic); entity.setFrequency(frequency); + entity.setCores(cores); + entity.setRAM(ram); entity.setTP(tp); entity.setMP(mp); entity.setStatic(static_); entity.setFarmer(farmer); + entity.setDead(dead); + entity.setOrientation(orientation); if (farmer >= 0) { entity.setFarmerName(scenario.getFarmer(farmer).name); entity.setFarmerCountry(scenario.getFarmer(farmer).country); @@ -137,6 +147,7 @@ public Entity createEntity(Generator generator, Scenario scenario, Fight fight) entity.setHat(hat); entity.setMetal(metal); entity.setFace(face); + entity.setInitialCell(cell); for (Object w : weapons) { var weapon = Weapons.getWeapon((Integer) w); @@ -166,6 +177,8 @@ public JSONObject toJson() { json.put("science", science); json.put("magic", magic); json.put("frequency", frequency); + json.put("cores", cores); + json.put("ram", ram); json.put("tp", tp); json.put("mp", mp); json.put("static", static_); diff --git a/src/main/java/com/leekwars/generator/state/Entity.java b/src/main/java/com/leekwars/generator/state/Entity.java index 4ca3cd5..23d7fe2 100644 --- a/src/main/java/com/leekwars/generator/state/Entity.java +++ b/src/main/java/com/leekwars/generator/state/Entity.java @@ -23,6 +23,7 @@ import com.leekwars.generator.effect.EffectShackleStrength; import com.leekwars.generator.effect.EffectShackleTP; import com.leekwars.generator.effect.EffectShackleWisdom; +import com.leekwars.generator.items.Item; import com.leekwars.generator.leek.Leek; import com.leekwars.generator.leek.Registers; import com.leekwars.generator.maps.Cell; @@ -55,6 +56,8 @@ public abstract class Entity { public final static int CHARAC_MAGIC = 13; public final static int CHARAC_DAMAGE_RETURN = 14; public final static int CHARAC_POWER = 15; + public final static int CHARAC_CORES = 16; + public final static int CHARAC_RAM = 17; // Characteristics protected Cell cell; @@ -119,12 +122,14 @@ public abstract class Entity { private Object logs; private Object fight; private Object aiFile; + private Integer initialCell = null; + private int orientation = -1; public Entity() { this(0, ""); } - public Entity(Integer id, String name, int farmer, int level, int life, int turn_point, int move_point, int force, int agility, int frequency, int wisdom, int resistance, int science, int magic, int skin, boolean metal, int face, int team_id, String team_name, int ai_id, String ai_name, String farmer_name, String farmer_country, int hat) { + public Entity(Integer id, String name, int farmer, int level, int life, int turn_point, int move_point, int force, int agility, int frequency, int wisdom, int resistance, int science, int magic, int cores, int ram, int skin, boolean metal, int face, int team_id, String team_name, int ai_id, String ai_name, String farmer_name, String farmer_country, int hat) { mId = id; this.name = name; @@ -147,6 +152,8 @@ public Entity(Integer id, String name, int farmer, int level, int life, int turn mBaseStats.setStat(CHARAC_RESISTANCE, resistance); mBaseStats.setStat(CHARAC_SCIENCE, science); mBaseStats.setStat(CHARAC_MAGIC, magic); + mBaseStats.setStat(CHARAC_CORES, cores); + mBaseStats.setStat(CHARAC_RAM, ram); mTotalLife = mBaseStats.getStat(CHARAC_LIFE); mInitialLife = mTotalLife; @@ -184,6 +191,8 @@ public Entity(Integer id, String name) { mBaseStats.setStat(CHARAC_RESISTANCE, 0); mBaseStats.setStat(CHARAC_SCIENCE, 0); mBaseStats.setStat(CHARAC_MAGIC, 0); + mBaseStats.setStat(CHARAC_CORES, 0); + mBaseStats.setStat(CHARAC_RAM, 0); mTotalLife = mBaseStats.getStat(CHARAC_LIFE); this.life = mTotalLife; @@ -408,6 +417,14 @@ public int getFrequency() { return getStat(Entity.CHARAC_FREQUENCY); } + public int getCores() { + return getStat(Entity.CHARAC_CORES); + } + + public int getRAM() { + return getStat(Entity.CHARAC_RAM); + } + public int getTotalTP() { return getStat(Entity.CHARAC_TP); } @@ -452,7 +469,7 @@ public boolean isDead() { return life <= 0; } - public void removeLife(int pv, int erosion, Entity attacker, DamageType type, Effect effect) { + public void removeLife(int pv, int erosion, Entity attacker, DamageType type, Effect effect, Item item) { if (isDead()) return; @@ -472,7 +489,7 @@ public void removeLife(int pv, int erosion, Entity attacker, DamageType type, Ef if (mTotalLife < 1) mTotalLife = 1; if (life <= 0) { - state.onPlayerDie(this, attacker); + state.onPlayerDie(this, attacker, item); die(); } } @@ -710,7 +727,7 @@ public void die() { List entities = new ArrayList(state.getTeamEntities(getTeam())); for (Entity e : entities) { if (e.isSummon() && e.getSummoner().getFId() == getFId()) { - state.onPlayerDie(e, null); + state.onPlayerDie(e, null, null); e.die(); } } @@ -718,9 +735,13 @@ public void die() { public void updateBuffStats() { mBuffStats.clear(); + states.clear(); for (Effect effect : effects) { if (effect.getStats() != null) mBuffStats.addStats(effect.getStats()); + if (effect.getState() != null) { + states.add(effect.getState()); + } } } @@ -825,8 +846,11 @@ public void applyCoolDown() { } public void addChip(Chip chip) { - if (chip != null) - mChips.put(chip.getId(), chip); + if (chip != null) { + if (mChips.size() < getRAM()) { + mChips.put(chip.getId(), chip); + } + } } // Chip has just been used, we must store the cooldown (entity cooldown) @@ -892,9 +916,13 @@ public void setLevel(int level) { mLevel = level; } - public void resurrect(Entity entity, double factor) { - mTotalLife = Math.max(10, (int) Math.round(mTotalLife * 0.5 * factor)); - life = mTotalLife / 2; + public void resurrect(Entity entity, double factor, boolean fullLife) { + if (fullLife) { + life = mTotalLife; + } else { + mTotalLife = Math.max(10, (int) Math.round(mTotalLife * 0.5 * factor)); + life = mTotalLife / 2; + } resurrected++; endTurn(); } @@ -951,6 +979,12 @@ public void setMagic(int magic) { public void setFrequency(int frequency) { mBaseStats.setStat(CHARAC_FREQUENCY, frequency); } + public void setCores(int cores) { + mBaseStats.setStat(CHARAC_CORES, cores); + } + public void setRAM(int ram) { + mBaseStats.setStat(CHARAC_RAM, ram); + } public void setTP(int tp) { mBaseStats.setStat(CHARAC_TP, tp); } @@ -1104,4 +1138,26 @@ public int getBirthTurn() { public void addOperations(long operations) { this.totalOperations += operations; } + + public void setInitialCell(Integer cell) { + this.initialCell = cell; + } + + public Integer getInitialCell() { + return initialCell; + } + + public void setDead(boolean dead) { + if (dead) { + this.life = 0; + } + } + + public void setOrientation(int orientation) { + this.orientation = orientation; + } + + public int getOrientation() { + return this.orientation; + } } diff --git a/src/main/java/com/leekwars/generator/state/State.java b/src/main/java/com/leekwars/generator/state/State.java index 8bcf24b..c75b926 100644 --- a/src/main/java/com/leekwars/generator/state/State.java +++ b/src/main/java/com/leekwars/generator/state/State.java @@ -33,6 +33,7 @@ import com.leekwars.generator.effect.Effect; import com.leekwars.generator.effect.EffectParameters; import com.leekwars.generator.entity.Bulb; +import com.leekwars.generator.items.Item; import com.leekwars.generator.items.Items; import com.leekwars.generator.leek.Leek; import com.leekwars.generator.leek.RegisterManager; @@ -412,7 +413,9 @@ public void init() { } } for (Entity e : bootorder.compute(this)) { - this.order.addEntity(e); + if (e.isAlive()) { + this.order.addEntity(e); + } actions.addEntity(e, false); initialOrder.add(e); @@ -465,13 +468,15 @@ public void startTurn() throws Exception { endTurn(); } - public void onPlayerDie(Entity entity, Entity killer) { + public void onPlayerDie(Entity entity, Entity killer, Item item) { + + var killCell = entity.getCell(); order.removeEntity(entity); this.map.removeEntity(entity); actions.log(new ActionEntityDie(entity, killer)); - statistics.kill(killer, entity); + statistics.kill(killer, entity, item, killCell); // BR : give 10 (or 2 for bulb) power + 50% of power to the killer if (this.type == State.TYPE_BATTLE_ROYALE && killer != null) { @@ -801,7 +806,7 @@ public int summonEntity(Entity caster, Cell target, Chip template) { return result; } - public int resurrectEntity(Entity caster, Cell target, Chip template, Entity target_entity) { + public int resurrectEntity(Entity caster, Cell target, Chip template, Entity target_entity, boolean fullLife) { if (order.current() != caster) { return Attack.USE_INVALID_TARGET; @@ -816,7 +821,7 @@ public int resurrectEntity(Entity caster, Cell target, Chip template, Entity tar return Attack.USE_INVALID_COOLDOWN; } EffectParameters params = template.getAttack().getEffectParametersByType(Effect.TYPE_RESURRECT); - if (params == null || !target.available(map) || !target_entity.isDead() || target_entity.getTeam() != caster.getTeam()) { + if (params == null || !target.available(map) || !target_entity.isDead()) { return Attack.USE_INVALID_TARGET; } @@ -835,7 +840,7 @@ public int resurrectEntity(Entity caster, Cell target, Chip template, Entity tar if (critical) caster.onCritical(); // Resurrect - resurrect(caster, target_entity, target, critical); + resurrect(caster, target_entity, target, critical, fullLife); statistics.useChip(caster, template, target, new ArrayList<>(), null); statistics.resurrect(caster, target_entity); @@ -888,7 +893,7 @@ public void removeInvocation(Entity invoc, boolean force) { } } - public void resurrect(Entity owner, Entity entity, Cell cell, boolean critical) { + public void resurrect(Entity owner, Entity entity, Cell cell, boolean critical, boolean fullLife) { Entity next = null; boolean start = false; @@ -911,7 +916,7 @@ public void resurrect(Entity owner, Entity entity, Cell cell, boolean critical) } else { order.addEntity(order.getEntityTurnOrder(next) - 1, entity); } - entity.resurrect(owner, critical ? Effect.CRITICAL_FACTOR : 1.0); + entity.resurrect(owner, critical ? Effect.CRITICAL_FACTOR : 1.0, fullLife); // On met la cellule this.map.setEntity(entity, cell); diff --git a/src/main/java/com/leekwars/generator/statistics/StatisticsManager.java b/src/main/java/com/leekwars/generator/statistics/StatisticsManager.java index 452d92d..ec825da 100644 --- a/src/main/java/com/leekwars/generator/statistics/StatisticsManager.java +++ b/src/main/java/com/leekwars/generator/statistics/StatisticsManager.java @@ -8,6 +8,7 @@ import com.leekwars.generator.attack.DamageType; import com.leekwars.generator.chips.Chip; import com.leekwars.generator.effect.Effect; +import com.leekwars.generator.items.Item; import com.leekwars.generator.maps.Cell; import com.leekwars.generator.state.Entity; import com.leekwars.generator.weapons.Weapon; @@ -29,7 +30,7 @@ public interface StatisticsManager { public void error(Entity entity); public void useChip(Entity caster, Chip chip, Cell cell, List targets, Entity cellEntity); public void useWeapon(Entity caster, Weapon weapon, Cell cell, List targets, Entity cellEntity); - public void kill(Entity killer, Entity entity); + public void kill(Entity killer, Entity entity, Item item, Cell killCell); public void critical(Entity launcher); public void endFight(Collection values); public void addTimes(Entity current, long time, long operations); diff --git a/src/main/java/com/leekwars/generator/test/LocalTrophyManager.java b/src/main/java/com/leekwars/generator/test/LocalTrophyManager.java index ba9431c..41e8a3a 100644 --- a/src/main/java/com/leekwars/generator/test/LocalTrophyManager.java +++ b/src/main/java/com/leekwars/generator/test/LocalTrophyManager.java @@ -14,6 +14,7 @@ import com.leekwars.generator.weapons.Weapon; import com.leekwars.generator.fight.Fight; import com.leekwars.generator.fight.StatisticsManager; +import com.leekwars.generator.items.Item; public class LocalTrophyManager implements StatisticsManager { @@ -73,7 +74,7 @@ public void useWeapon(Entity caster, Weapon weapon, Cell cell, List targ } @Override - public void kill(Entity killer, Entity entity) { + public void kill(Entity killer, Entity entity, Item item, Cell killCell) { // TODO Auto-generated method stub } diff --git a/src/main/java/com/leekwars/generator/weapons/Weapon.java b/src/main/java/com/leekwars/generator/weapons/Weapon.java index 243e768..352b997 100644 --- a/src/main/java/com/leekwars/generator/weapons/Weapon.java +++ b/src/main/java/com/leekwars/generator/weapons/Weapon.java @@ -15,6 +15,7 @@ public class Weapon extends Item { public Weapon(int id, int cost, int minRange, int maxRange, JSONArray effects, byte launchType, byte area, boolean los, int template, String name, JSONArray passiveEffects) { super(id, cost, name, template, new Attack(minRange, maxRange, launchType, area, los, effects, Attack.TYPE_WEAPON, id)); + this.attack.setItem(this); for (Object e : passiveEffects) { JSONObject effect = (JSONObject) e; diff --git a/src/test/java/test/TestFightFunctions.java b/src/test/java/test/TestFightFunctions.java index 7d4e2d0..cfbcdc6 100644 --- a/src/test/java/test/TestFightFunctions.java +++ b/src/test/java/test/TestFightFunctions.java @@ -63,7 +63,7 @@ public void nullPointerTest() throws Exception { // map.getCell(203).setPlayer(leek2); // map.getCell(306).setPlayer(leek1); - leek2.removeLife(leek2.getLife(), 0, leek1, DamageType.DIRECT, null); + leek2.removeLife(leek2.getLife(), 0, leek1, DamageType.DIRECT, null, null); ArrayList codes = new ArrayList(); ArrayList values = new ArrayList(); diff --git a/src/test/java/test/TestLeekFunctions.java b/src/test/java/test/TestLeekFunctions.java index 5c251f8..54a23a2 100644 --- a/src/test/java/test/TestLeekFunctions.java +++ b/src/test/java/test/TestLeekFunctions.java @@ -30,8 +30,8 @@ public void setUp() throws Exception { generator = new Generator(); mFight = new Fight(generator); - mLeek1 = new Leek(1, "Test", 0, 10, 500, 6, 7, 150, 151, 10, 56, 9, 0, 0, 0, false, 0, 0, "Noname", 0, "", "", "", 0); - mLeek2 = new Leek(2, "Bob", 0, 10, 510, 4, 6, 152, 154, 11, 46, 8, 0, 0, 0, false, 0, 0, "Noname", 0, "", "", "", 0); + mLeek1 = new Leek(1, "Test", 0, 10, 500, 6, 7, 150, 151, 10, 56, 9, 0, 0, 0, 0, 0, false, 0, 0, "Noname", 0, "", "", "", 0); + mLeek2 = new Leek(2, "Bob", 0, 10, 510, 4, 6, 152, 154, 11, 46, 8, 0, 0, 0, 0, 0, false, 0, 0, "Noname", 0, "", "", "", 0); mFight.getState().addEntity(0, mLeek1); mFight.getState().addEntity(1, mLeek2);