diff --git a/core/src/fr/evolving/automata/Filter1.java b/core/src/fr/evolving/automata/Filter1.java index 9b8362c..fc9bf97 100644 --- a/core/src/fr/evolving/automata/Filter1.java +++ b/core/src/fr/evolving/automata/Filter1.java @@ -121,7 +121,11 @@ public class Filter1 extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } public void Activate() { if (this.Activable) @@ -177,7 +181,7 @@ public class Filter1 extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Filter2.java b/core/src/fr/evolving/automata/Filter2.java index 8e2b21e..d705cbe 100644 --- a/core/src/fr/evolving/automata/Filter2.java +++ b/core/src/fr/evolving/automata/Filter2.java @@ -121,7 +121,11 @@ public class Filter2 extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -176,7 +180,7 @@ public class Filter2 extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Filter4.java b/core/src/fr/evolving/automata/Filter4.java index 30acee7..1e35611 100644 --- a/core/src/fr/evolving/automata/Filter4.java +++ b/core/src/fr/evolving/automata/Filter4.java @@ -120,7 +120,11 @@ public class Filter4 extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -175,7 +179,7 @@ public class Filter4 extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Filter4Activable.java b/core/src/fr/evolving/automata/Filter4Activable.java index 2109b1a..e244bf2 100644 --- a/core/src/fr/evolving/automata/Filter4Activable.java +++ b/core/src/fr/evolving/automata/Filter4Activable.java @@ -121,7 +121,11 @@ public class Filter4Activable extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -176,7 +180,7 @@ public class Filter4Activable extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Filter8Activable.java b/core/src/fr/evolving/automata/Filter8Activable.java index 02ae9ee..0601817 100644 --- a/core/src/fr/evolving/automata/Filter8Activable.java +++ b/core/src/fr/evolving/automata/Filter8Activable.java @@ -120,7 +120,11 @@ public class Filter8Activable extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -175,7 +179,7 @@ public class Filter8Activable extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/FilterActivable.java b/core/src/fr/evolving/automata/FilterActivable.java index 7d564b8..feb602d 100644 --- a/core/src/fr/evolving/automata/FilterActivable.java +++ b/core/src/fr/evolving/automata/FilterActivable.java @@ -120,7 +120,11 @@ public class FilterActivable extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -175,7 +179,7 @@ public class FilterActivable extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/FilterBig.java b/core/src/fr/evolving/automata/FilterBig.java index 0edc937..90f97ed 100644 --- a/core/src/fr/evolving/automata/FilterBig.java +++ b/core/src/fr/evolving/automata/FilterBig.java @@ -120,7 +120,11 @@ public class FilterBig extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -175,7 +179,7 @@ public class FilterBig extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/FilterNegative.java b/core/src/fr/evolving/automata/FilterNegative.java index bd54e54..face6ad 100644 --- a/core/src/fr/evolving/automata/FilterNegative.java +++ b/core/src/fr/evolving/automata/FilterNegative.java @@ -120,7 +120,11 @@ public class FilterNegative extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -175,7 +179,7 @@ public class FilterNegative extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/FilterPositive.java b/core/src/fr/evolving/automata/FilterPositive.java index 5d93b2e..9a355f2 100644 --- a/core/src/fr/evolving/automata/FilterPositive.java +++ b/core/src/fr/evolving/automata/FilterPositive.java @@ -119,7 +119,11 @@ public class FilterPositive extends Transmuter { this.level.Nrj += UsedNrj * UpgradedNrj; } - + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -174,7 +178,7 @@ public class FilterPositive extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Grid.java b/core/src/fr/evolving/automata/Grid.java index fa18025..d1084b4 100644 --- a/core/src/fr/evolving/automata/Grid.java +++ b/core/src/fr/evolving/automata/Grid.java @@ -58,11 +58,13 @@ public class Grid implements Serializable,Cloneable { Entry all = iterator.next(); CaseType thecase=transmuters.get(i).getTilestype(tiles.keys().toArray().indexOf(all.key, false)); Vector2 position=transmuterscoords.get(i); - if (GetXY(position.x+ all.key.x, position.y+ all.key.y).Fiber && position.x==particle.getCoordx() && position.y==particle.getCoordy()) - if (thecase==CaseType.Fibre||thecase==CaseType.Tout||thecase==CaseType.Fibre_seul) - Gdx.app.debug("wirechem-Grid", "Grid Cycle -> Activation Photon state :"+GetXY(particle.getCoordx(), particle.getCoordy()).Fiber_state+":"+particle.getCoordx()+","+particle.getCoordy()+"Transmuter:"+transmuters.get(i).getName()+"/"+transmuters.get(i).getActivationLevel()); + if (GetXY(position.x+all.key.x,position.y+all.key.y).Fiber && position.x+all.key.x==particle.getCoordx() && position.y+all.key.y==particle.getCoordy()) + if (thecase==CaseType.Fibre||thecase==CaseType.Tout||thecase==CaseType.Fibre_seul) { + Gdx.app.debug("wirechem-Grid", "Grid Cycle -> Activation Photon life:"+particle.getLife()+" coords:"+particle.getCoordx()+","+particle.getCoordy()+" Transmuter:"+transmuters.get(i).getName()+" activation:"+transmuters.get(i).getActivationLevel()); particle.subLife(transmuters.get(i).getMaxActivationLevel()-transmuters.get(i).getActivationLevel()); transmuters.get(i).Activate(); + Gdx.app.debug("wirechem-Grid", "Grid Cycle -> Activation Photon life:"+particle.getLife()+" coords:"+particle.getCoordx()+","+particle.getCoordy()+" Transmuter:"+transmuters.get(i).getName()+" activation:"+transmuters.get(i).getActivationLevel()); + } } } if (!particle.isAlive()) { @@ -106,6 +108,7 @@ public class Grid implements Serializable,Cloneable { for (int x = 0; x < this.sizeX; x++) for (int y = 0; y < this.sizeY; y++) if (GetXY(x, y).Transmuter!=null) { + GetXY(x, y).Transmuter.Unactivate(); transmuters.add(GetXY(x, y).Transmuter); transmuterscoords.add(new Vector2(x,y)); } diff --git a/core/src/fr/evolving/automata/Insufler100.java b/core/src/fr/evolving/automata/Insufler100.java index afd5d5a..8053dc0 100644 --- a/core/src/fr/evolving/automata/Insufler100.java +++ b/core/src/fr/evolving/automata/Insufler100.java @@ -131,7 +131,12 @@ public class Insufler100 extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -186,7 +191,7 @@ public class Insufler100 extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Insufler33.java b/core/src/fr/evolving/automata/Insufler33.java index 5808fea..a561e32 100644 --- a/core/src/fr/evolving/automata/Insufler33.java +++ b/core/src/fr/evolving/automata/Insufler33.java @@ -132,7 +132,12 @@ public class Insufler33 extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -187,7 +192,7 @@ public class Insufler33 extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Insufler50.java b/core/src/fr/evolving/automata/Insufler50.java index b3a3489..20d0f64 100644 --- a/core/src/fr/evolving/automata/Insufler50.java +++ b/core/src/fr/evolving/automata/Insufler50.java @@ -131,7 +131,12 @@ public class Insufler50 extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -186,7 +191,7 @@ public class Insufler50 extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Inverter_I.java b/core/src/fr/evolving/automata/Inverter_I.java index a7c2f91..5d9c112 100644 --- a/core/src/fr/evolving/automata/Inverter_I.java +++ b/core/src/fr/evolving/automata/Inverter_I.java @@ -114,7 +114,12 @@ public class Inverter_I extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -169,7 +174,7 @@ public class Inverter_I extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Inverter_II.java b/core/src/fr/evolving/automata/Inverter_II.java index 86a9602..68389cf 100644 --- a/core/src/fr/evolving/automata/Inverter_II.java +++ b/core/src/fr/evolving/automata/Inverter_II.java @@ -113,7 +113,12 @@ public class Inverter_II extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -168,7 +173,7 @@ public class Inverter_II extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Negativer.java b/core/src/fr/evolving/automata/Negativer.java index c524f66..e91711b 100644 --- a/core/src/fr/evolving/automata/Negativer.java +++ b/core/src/fr/evolving/automata/Negativer.java @@ -114,7 +114,12 @@ public class Negativer extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -169,7 +174,7 @@ public class Negativer extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Negativer_I.java b/core/src/fr/evolving/automata/Negativer_I.java index 0030184..ec302f2 100644 --- a/core/src/fr/evolving/automata/Negativer_I.java +++ b/core/src/fr/evolving/automata/Negativer_I.java @@ -116,7 +116,12 @@ public class Negativer_I extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -171,7 +176,7 @@ public class Negativer_I extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Negativer_II.java b/core/src/fr/evolving/automata/Negativer_II.java index 7f2db9e..3ea6b02 100644 --- a/core/src/fr/evolving/automata/Negativer_II.java +++ b/core/src/fr/evolving/automata/Negativer_II.java @@ -116,7 +116,12 @@ public class Negativer_II extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -171,7 +176,7 @@ public class Negativer_II extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Negativer_III.java b/core/src/fr/evolving/automata/Negativer_III.java index 4defb17..04d44b7 100644 --- a/core/src/fr/evolving/automata/Negativer_III.java +++ b/core/src/fr/evolving/automata/Negativer_III.java @@ -114,7 +114,12 @@ public class Negativer_III extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -169,7 +174,7 @@ public class Negativer_III extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Neutraliser_I.java b/core/src/fr/evolving/automata/Neutraliser_I.java index 7c71b5b..6b0a3ea 100644 --- a/core/src/fr/evolving/automata/Neutraliser_I.java +++ b/core/src/fr/evolving/automata/Neutraliser_I.java @@ -114,7 +114,12 @@ public class Neutraliser_I extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -169,7 +174,7 @@ public class Neutraliser_I extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Neutraliser_II.java b/core/src/fr/evolving/automata/Neutraliser_II.java index 11045f8..a6684fc 100644 --- a/core/src/fr/evolving/automata/Neutraliser_II.java +++ b/core/src/fr/evolving/automata/Neutraliser_II.java @@ -114,7 +114,12 @@ public class Neutraliser_II extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -169,7 +174,7 @@ public class Neutraliser_II extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Oneway.java b/core/src/fr/evolving/automata/Oneway.java index f7824d4..467a5c9 100644 --- a/core/src/fr/evolving/automata/Oneway.java +++ b/core/src/fr/evolving/automata/Oneway.java @@ -115,7 +115,12 @@ public class Oneway extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -170,7 +175,7 @@ public class Oneway extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Particle.java b/core/src/fr/evolving/automata/Particle.java index 911a602..1a6c6b8 100644 --- a/core/src/fr/evolving/automata/Particle.java +++ b/core/src/fr/evolving/automata/Particle.java @@ -59,7 +59,7 @@ public class Particle { } public void subLife(int sub) { - this.life=life-sub; + this.life-=sub; if (this.life<=0) { this.life=0; this.kill(); diff --git a/core/src/fr/evolving/automata/Positiver.java b/core/src/fr/evolving/automata/Positiver.java index b0f86a8..6d3d596 100644 --- a/core/src/fr/evolving/automata/Positiver.java +++ b/core/src/fr/evolving/automata/Positiver.java @@ -114,7 +114,12 @@ public class Positiver extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -169,7 +174,7 @@ public class Positiver extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Positiver_I.java b/core/src/fr/evolving/automata/Positiver_I.java index b224f23..0e40098 100644 --- a/core/src/fr/evolving/automata/Positiver_I.java +++ b/core/src/fr/evolving/automata/Positiver_I.java @@ -116,7 +116,12 @@ public class Positiver_I extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -171,7 +176,7 @@ public class Positiver_I extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Positiver_II.java b/core/src/fr/evolving/automata/Positiver_II.java index a7e6842..a267643 100644 --- a/core/src/fr/evolving/automata/Positiver_II.java +++ b/core/src/fr/evolving/automata/Positiver_II.java @@ -116,7 +116,12 @@ public class Positiver_II extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -171,7 +176,7 @@ public class Positiver_II extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Positiver_III.java b/core/src/fr/evolving/automata/Positiver_III.java index e5e2dbc..bff4708 100644 --- a/core/src/fr/evolving/automata/Positiver_III.java +++ b/core/src/fr/evolving/automata/Positiver_III.java @@ -113,7 +113,12 @@ public class Positiver_III extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } + public void Activate() { if (this.Activable) ActivationLevel = this.getMaxActivationLevel(); @@ -168,7 +173,7 @@ public class Positiver_III extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() { diff --git a/core/src/fr/evolving/automata/Transmuter.java b/core/src/fr/evolving/automata/Transmuter.java index cecaffe..c08f5b7 100644 --- a/core/src/fr/evolving/automata/Transmuter.java +++ b/core/src/fr/evolving/automata/Transmuter.java @@ -92,6 +92,9 @@ public abstract class Transmuter implements Cloneable, Serializable { public void Activate() { } + + public void Unactivate() { + } public void UpgradeTemp() { } diff --git a/core/src/fr/evolving/automata/distributor.java b/core/src/fr/evolving/automata/distributor.java index 08da1e4..0080d08 100644 --- a/core/src/fr/evolving/automata/distributor.java +++ b/core/src/fr/evolving/automata/distributor.java @@ -122,7 +122,11 @@ public class distributor extends Transmuter { this.level.Rayon += UsedRayon * UpgradedRayon; this.level.Nrj += UsedNrj * UpgradedNrj; } - + + public void Unactivate() { + if (this.Activable) + ActivationLevel = 0; + } public void Activate() { if (this.Activable) @@ -178,7 +182,7 @@ public class distributor extends Transmuter { } public int getMaxActivationLevel() { - return ActivationLevel = (int) (10 * this.UpgradedCycle); + return (int) (10 * this.UpgradedCycle); } public int getActivationLevel() {