11package exogenesis ;
22
33import arc .Events ;
4+ import arc .math .Mathf ;
5+ import arc .util .Log ;
46import exogenesis .entities .EntityRegister ;
57import exogenesis .graphics .ExoShaders ;
8+ import exogenesis .type .bullet .TypedBulletType ;
9+ import exogenesis .util .func .DrawFunc ;
610import exogenesis .world .ExoTeams ;
11+ import mindustry .entities .Effect ;
12+ import mindustry .entities .bullet .BulletType ;
713import mindustry .game .EventType ;
814import exogenesis .util .util .Utils ;
915import exogenesis .content .ExoBlocks ;
1016import exogenesis .content .ExoVanstarBlocks ;
1117import exogenesis .content .ExoUnitTypes ;
1218import exogenesis .content .ExoStatusEffects ;
1319import exogenesis .content .*;
20+ import mindustry .gen .Unit ;
1421import mindustry .mod .Mod ;
1522import mindustry .mod .Mods ;
1623//import exogenesis.gen.*;
1926
2027public class ExogenesisMod extends Mod {
2128 public static Mods .LoadedMod MOD ;
29+ public static final boolean DEBUG = true ;
2230
2331 public ExogenesisMod (){
2432 Events .on (EventType .FileTreeInitEvent .class , e -> app .post (ExoShaders ::load ));
@@ -28,6 +36,18 @@ public ExogenesisMod(){
2836 Events .on (EventType .ContentInitEvent .class , e -> {
2937 ExoPostProcess .load ();
3038 });
39+
40+ if (DEBUG ){
41+ Events .on (EventType .UnitDamageEvent .class , event -> {
42+ BulletType type = event .bullet .type ();
43+ Unit unit = event .unit ;
44+ float damage = type .damage ;
45+ if (type instanceof TypedBulletType typedBulletType ) damage = typedBulletType .getTotalDamageToUnit (type .damage , unit );
46+ float finalDamage = Mathf .round (damage );
47+ Effect effect = new Effect (30 , e -> DrawFunc .drawText ("<" + finalDamage + ">" , unit .x , unit .y ));
48+ effect .at (unit );
49+ });
50+ }
3151 }
3252
3353 @ Override
0 commit comments