Updated images of the simulator

This commit is contained in:
Samy Avrillon 2024-06-27 16:51:44 +02:00
parent 6122aa1670
commit 6f3aac6a8a
Signed by: Mysaa
GPG Key ID: 0220AC4A3D6A328B
966 changed files with 265 additions and 48 deletions

View File

@ -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;
}
}

View File

@ -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")

View File

@ -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;

View 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;
}
}

View File

@ -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;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Some files were not shown because too many files have changed in this diff Show More