Updated images of the simulator
@ -5,8 +5,10 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bernard.greposimu.engine.Registerar;
|
||||
@ -16,6 +18,7 @@ import com.bernard.greposimu.model.Dieu;
|
||||
import com.bernard.greposimu.model.Heros;
|
||||
import com.bernard.greposimu.model.OffDefStats;
|
||||
import com.bernard.greposimu.model.game.GameData;
|
||||
import com.bernard.greposimu.model.game.Power;
|
||||
import com.fasterxml.jackson.core.JsonFactory;
|
||||
import com.fasterxml.jackson.core.StreamReadFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@ -42,6 +45,22 @@ public class GrepoSimu {
|
||||
ObjectMapper mapper = new ObjectMapper(jsonFactory);
|
||||
mapper.registerModule(module);
|
||||
GameData data = mapper.readValue(json, GameData.class);
|
||||
|
||||
// Adapting power map
|
||||
Map<String,Power> pmap = new HashMap<>();
|
||||
for(String id : data.powers.keySet()) {
|
||||
Set<String> types = data.powers.get(id).getTypes();
|
||||
if(types.isEmpty()) {
|
||||
pmap.put(id, new Power(data.powers.get(id)));
|
||||
} else {
|
||||
for(String type : types) {
|
||||
pmap.put(id+"."+type, new Power(data.powers.get(id), type));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
data.powers = pmap;
|
||||
System.out.println(data.powers.get("effort_of_the_huntress"));
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,8 +88,13 @@ public class Fight {
|
||||
}
|
||||
|
||||
public static List<Power> relevantDefPowers(GameData gd) {
|
||||
return List.of("acumen","divine_senses","myrmidion_attack","trojan_defense","defense_boost","defense_penalty","longterm_defense_boost","assassins_acumen","rare_defense_boost","epic_defense_boost","olympic_torch","olympic_senses","missions_power_4","divine_battle_strategy_rare","divine_battle_strategy_epic","naval_battle_strategy_rare","naval_battle_strategy_epic","land_battle_strategy_rare","land_battle_strategy_epic","soterias_shrine")
|
||||
.stream().map(gd.powers::get).toList();
|
||||
System.out.println(gd.powers);
|
||||
return List.of("acumen", "divine_senses", "myrmidion_attack", "trojan_defense", "defense_boost",
|
||||
"defense_penalty", "longterm_defense_boost", "assassins_acumen", "rare_defense_boost",
|
||||
"epic_defense_boost", "olympic_torch.grepolympia_summer", "olympic_senses.grepolympia_summer", "missions_power_4.missions_dionysia",
|
||||
"divine_battle_strategy_rare", "divine_battle_strategy_epic", "naval_battle_strategy_rare",
|
||||
"naval_battle_strategy_epic", "land_battle_strategy_rare", "land_battle_strategy_epic",
|
||||
"soterias_shrine.not_cast").stream().map(gd.powers::get).map(p -> (Power)p).toList();
|
||||
}
|
||||
public static List<Research> relevantDefResearch(GameData gd) {
|
||||
return List.of("divine_selection","phalanx","ram")
|
||||
|
||||
@ -14,7 +14,7 @@ public class GameData {
|
||||
|
||||
public Map<String,Unit> units;
|
||||
|
||||
public Map<String, Power> powers;
|
||||
public Map<String, ? extends JsonPower> powers;
|
||||
|
||||
public Map<String, God> gods;
|
||||
|
||||
|
||||
115
src/main/java/com/bernard/greposimu/model/game/JsonPower.java
Normal file
@ -0,0 +1,115 @@
|
||||
package com.bernard.greposimu.model.game;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class JsonPower {
|
||||
public Object effect;
|
||||
public Object name;
|
||||
public Object description;
|
||||
public int lifetime;
|
||||
public String id;
|
||||
public String short_effect;
|
||||
public int favor;
|
||||
public int fury_percentage_cost;
|
||||
public String god_id;
|
||||
public BigInteger temple_level_sum_dependency;
|
||||
public List<String> targets;
|
||||
public boolean only_own_towns;
|
||||
public boolean boost;
|
||||
public boolean is_fake_power;
|
||||
public List<String> area_of_effect;
|
||||
public boolean destructive;
|
||||
public boolean negative;
|
||||
public boolean extendible;
|
||||
public String power_group;
|
||||
public int power_group_level;
|
||||
public List<String> seeds_to;
|
||||
public Image images;
|
||||
public List<String> effects;
|
||||
public boolean is_valid_for_happenings;
|
||||
public List<String> meta_fields;
|
||||
public Object meta_defaults;
|
||||
public boolean removed_on_target_loss;
|
||||
public boolean needs_level;
|
||||
public boolean requires_god;
|
||||
public boolean ignores_democritus;
|
||||
public boolean display_amount;
|
||||
public boolean wasteable;
|
||||
public boolean is_ritual;
|
||||
public boolean recreate_on_restart;
|
||||
public boolean transfer_to_casual_world;
|
||||
public boolean is_onetime_power;
|
||||
public boolean is_upgradable;
|
||||
public boolean is_capped;
|
||||
public List<String> compatible_powers;
|
||||
public boolean no_lifetime;
|
||||
public boolean passive;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Set<String> getTypes() {
|
||||
Set<String> types = new HashSet<>();
|
||||
if(name instanceof Map) {
|
||||
if(((Map<String,Map<String,String>>)name).containsKey("type"))
|
||||
types.addAll(((Map<String,Map<String,String>>)name).get("type").keySet());
|
||||
else
|
||||
name = ((Map<String,Map<String,String>>)name).get("god").get("athena");
|
||||
}
|
||||
if(description instanceof Map)
|
||||
types.addAll(((Map<String,Map<String,String>>)description).get("type").keySet());
|
||||
if(effect instanceof Map)
|
||||
types.addAll(((Map<String,Map<String,String>>)effect).get("type").keySet());
|
||||
return types;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "JsonPower [effect=" + effect + ", lifetime=" + lifetime + ", id=" + id + ", name=" + name
|
||||
+ ", description=" + description + ", short_effect=" + short_effect + ", favor=" + favor
|
||||
+ ", fury_percentage_cost=" + fury_percentage_cost + ", god_id=" + god_id
|
||||
+ ", temple_level_sum_dependency=" + temple_level_sum_dependency + ", targets=" + targets
|
||||
+ ", only_own_towns=" + only_own_towns + ", boost=" + boost + ", is_fake_power=" + is_fake_power
|
||||
+ ", area_of_effect=" + area_of_effect + ", destructive=" + destructive + ", negative=" + negative
|
||||
+ ", extendible=" + extendible + ", power_group=" + power_group + ", power_group_level="
|
||||
+ power_group_level + ", seeds_to=" + seeds_to + ", images=" + images + ", effects=" + effects
|
||||
+ ", is_valid_for_happenings=" + is_valid_for_happenings + ", meta_fields=" + meta_fields
|
||||
+ ", meta_defaults=" + meta_defaults + ", removed_on_target_loss=" + removed_on_target_loss
|
||||
+ ", needs_level=" + needs_level + ", requires_god=" + requires_god + ", ignores_democritus="
|
||||
+ ignores_democritus + ", display_amount=" + display_amount + ", wasteable=" + wasteable
|
||||
+ ", is_ritual=" + is_ritual + ", recreate_on_restart=" + recreate_on_restart
|
||||
+ ", transfer_to_casual_world=" + transfer_to_casual_world + ", is_onetime_power=" + is_onetime_power
|
||||
+ ", is_upgradable=" + is_upgradable + ", is_capped=" + is_capped + ", compatible_powers="
|
||||
+ compatible_powers + ", no_lifetime=" + no_lifetime + ", passive=" + passive + "]";
|
||||
}
|
||||
|
||||
public Object getEffect() {
|
||||
return effect;
|
||||
}
|
||||
|
||||
public void setEffect(Object effect) {
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
public Object getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(Object name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Object getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(Object description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,48 +1,126 @@
|
||||
package com.bernard.greposimu.model.game;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Power {
|
||||
public Object effect;
|
||||
public int lifetime;
|
||||
public String id;
|
||||
public Object name;
|
||||
public Object description;
|
||||
public String short_effect;
|
||||
public int favor;
|
||||
public int fury_percentage_cost;
|
||||
public String god_id;
|
||||
public BigInteger temple_level_sum_dependency;
|
||||
public List<String> targets;
|
||||
public boolean only_own_towns;
|
||||
public boolean boost;
|
||||
public boolean is_fake_power;
|
||||
public List<Object> area_of_effect;
|
||||
public boolean destructive;
|
||||
public boolean negative;
|
||||
public boolean extendible;
|
||||
public String power_group;
|
||||
public int power_group_level;
|
||||
public List<String> seeds_to;
|
||||
public Image images;
|
||||
public List<String> effects;
|
||||
public boolean is_valid_for_happenings;
|
||||
public List<String> meta_fields;
|
||||
public Object meta_defaults;
|
||||
public boolean removed_on_target_loss;
|
||||
public boolean needs_level;
|
||||
public boolean requires_god;
|
||||
public boolean ignores_democritus;
|
||||
public boolean display_amount;
|
||||
public boolean wasteable;
|
||||
public boolean is_ritual;
|
||||
public boolean recreate_on_restart;
|
||||
public boolean transfer_to_casual_world;
|
||||
public boolean is_onetime_power;
|
||||
public boolean is_upgradable;
|
||||
public boolean is_capped;
|
||||
public List<String> compatible_powers;
|
||||
public boolean no_lifetime;
|
||||
public boolean passive;
|
||||
public class Power extends JsonPower {
|
||||
public String effect;
|
||||
public String name;
|
||||
public String description;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Power(JsonPower power, String type) {
|
||||
this.effect = (power.effect instanceof String)?(String)power.effect:((Map<String,Map<String,String>>)power.effect).get("type").get(type);
|
||||
this.lifetime = power.lifetime;
|
||||
this.id = power.id+"."+type;
|
||||
this.name = (power.name instanceof String)?(String)power.name:((Map<String,Map<String,String>>)power.name).get("type").get(type);
|
||||
this.description = (power.description instanceof String)?(String)power.description:((Map<String,Map<String,String>>)power.description).get("type").get(type);
|
||||
this.short_effect = power.short_effect;
|
||||
this.favor = power.favor;
|
||||
this.fury_percentage_cost = power.fury_percentage_cost;
|
||||
this.god_id = power.god_id;
|
||||
this.temple_level_sum_dependency = power.temple_level_sum_dependency;
|
||||
this.targets = power.targets;
|
||||
this.only_own_towns = power.only_own_towns;
|
||||
this.boost = power.boost;
|
||||
this.is_fake_power = power.is_fake_power;
|
||||
this.area_of_effect = power.area_of_effect;
|
||||
this.destructive = power.destructive;
|
||||
this.negative = power.negative;
|
||||
this.extendible = power.extendible;
|
||||
this.power_group = power.power_group;
|
||||
this.power_group_level = power.power_group_level;
|
||||
this.seeds_to = power.seeds_to;
|
||||
this.images = power.images;
|
||||
this.effects = power.effects;
|
||||
this.is_valid_for_happenings = power.is_valid_for_happenings;
|
||||
this.meta_fields = power.meta_fields;
|
||||
this.meta_defaults = power.meta_defaults;
|
||||
this.removed_on_target_loss = power.removed_on_target_loss;
|
||||
this.needs_level = power.needs_level;
|
||||
this.requires_god = power.requires_god;
|
||||
this.ignores_democritus = power.ignores_democritus;
|
||||
this.display_amount = power.display_amount;
|
||||
this.wasteable = power.wasteable;
|
||||
this.is_ritual = power.is_ritual;
|
||||
this.recreate_on_restart = power.recreate_on_restart;
|
||||
this.transfer_to_casual_world = power.transfer_to_casual_world;
|
||||
this.is_onetime_power = power.is_onetime_power;
|
||||
this.is_upgradable = power.is_upgradable;
|
||||
this.is_capped = power.is_capped;
|
||||
this.compatible_powers = power.compatible_powers;
|
||||
this.no_lifetime = power.no_lifetime;
|
||||
this.passive = power.passive;
|
||||
}
|
||||
public Power(JsonPower power) {
|
||||
this.effect = (String) power.effect;
|
||||
this.lifetime = power.lifetime;
|
||||
this.id = power.id;
|
||||
this.name = (String) power.name;
|
||||
this.description = (String) power.description;
|
||||
this.short_effect = power.short_effect;
|
||||
this.favor = power.favor;
|
||||
this.fury_percentage_cost = power.fury_percentage_cost;
|
||||
this.god_id = power.god_id;
|
||||
this.temple_level_sum_dependency = power.temple_level_sum_dependency;
|
||||
this.targets = power.targets;
|
||||
this.only_own_towns = power.only_own_towns;
|
||||
this.boost = power.boost;
|
||||
this.is_fake_power = power.is_fake_power;
|
||||
this.area_of_effect = power.area_of_effect;
|
||||
this.destructive = power.destructive;
|
||||
this.negative = power.negative;
|
||||
this.extendible = power.extendible;
|
||||
this.power_group = power.power_group;
|
||||
this.power_group_level = power.power_group_level;
|
||||
this.seeds_to = power.seeds_to;
|
||||
this.images = power.images;
|
||||
this.effects = power.effects;
|
||||
this.is_valid_for_happenings = power.is_valid_for_happenings;
|
||||
this.meta_fields = power.meta_fields;
|
||||
this.meta_defaults = power.meta_defaults;
|
||||
this.removed_on_target_loss = power.removed_on_target_loss;
|
||||
this.needs_level = power.needs_level;
|
||||
this.requires_god = power.requires_god;
|
||||
this.ignores_democritus = power.ignores_democritus;
|
||||
this.display_amount = power.display_amount;
|
||||
this.wasteable = power.wasteable;
|
||||
this.is_ritual = power.is_ritual;
|
||||
this.recreate_on_restart = power.recreate_on_restart;
|
||||
this.transfer_to_casual_world = power.transfer_to_casual_world;
|
||||
this.is_onetime_power = power.is_onetime_power;
|
||||
this.is_upgradable = power.is_upgradable;
|
||||
this.is_capped = power.is_capped;
|
||||
this.compatible_powers = power.compatible_powers;
|
||||
this.no_lifetime = power.no_lifetime;
|
||||
this.passive = power.passive;
|
||||
}
|
||||
|
||||
|
||||
public String getEffect() {
|
||||
return effect;
|
||||
}
|
||||
|
||||
public void setEffect(String effect) {
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
BIN
src/main/resources/static/images/counsellors/administrator.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
src/main/resources/static/images/counsellors/captain.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
src/main/resources/static/images/counsellors/commander.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
src/main/resources/static/images/counsellors/priest.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
src/main/resources/static/images/counsellors/trader.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
src/main/resources/static/images/powers/a_new_hope.disabled.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/resources/static/images/powers/a_new_hope.hover.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
src/main/resources/static/images/powers/a_new_hope.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
src/main/resources/static/images/powers/acumen.disabled.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/main/resources/static/images/powers/acumen.hover.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
src/main/resources/static/images/powers/acumen.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
BIN
src/main/resources/static/images/powers/archer_generation.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/main/resources/static/images/powers/archer_instant.hover.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
src/main/resources/static/images/powers/archer_instant.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
src/main/resources/static/images/powers/ares_army.disabled.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
src/main/resources/static/images/powers/ares_army.hover.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
src/main/resources/static/images/powers/ares_army.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
src/main/resources/static/images/powers/ares_rage.disabled.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
src/main/resources/static/images/powers/ares_rage.hover.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
src/main/resources/static/images/powers/ares_rage.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/main/resources/static/images/powers/ares_sacrifice.hover.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
src/main/resources/static/images/powers/ares_sacrifice.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
BIN
src/main/resources/static/images/powers/assassins_acumen.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/main/resources/static/images/powers/attack_boost.hover.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
src/main/resources/static/images/powers/attack_boost.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/main/resources/static/images/powers/attack_penalty.hover.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
src/main/resources/static/images/powers/attack_penalty.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
BIN
src/main/resources/static/images/powers/attack_ship_instant.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
BIN
src/main/resources/static/images/powers/aura_of_healing.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
BIN
src/main/resources/static/images/powers/bireme_generation.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/resources/static/images/powers/bireme_instant.hover.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
src/main/resources/static/images/powers/bireme_instant.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |