feat: ajout de unactivate dans les transmuters activation fonctionnelle mise à jour graphique de la vie non operationnel

This commit is contained in:
Nicolas Hordé 2016-08-25 15:16:20 +02:00
parent ea59612ae5
commit cfcb8ab121
29 changed files with 182 additions and 56 deletions

View File

@ -122,6 +122,10 @@ public class Filter1 extends Transmuter {
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() {

View File

@ -121,6 +121,10 @@ public class Filter2 extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -120,6 +120,10 @@ public class Filter4 extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -121,6 +121,10 @@ public class Filter4Activable extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -120,6 +120,10 @@ public class Filter8Activable extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -120,6 +120,10 @@ public class FilterActivable extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -120,6 +120,10 @@ public class FilterBig extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -120,6 +120,10 @@ public class FilterNegative extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -119,6 +119,10 @@ public class FilterPositive extends Transmuter {
this.level.Nrj += UsedNrj * UpgradedNrj;
}
public void Unactivate() {
if (this.Activable)
ActivationLevel = 0;
}
public void Activate() {
if (this.Activable)
@ -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() {

View File

@ -58,11 +58,13 @@ public class Grid implements Serializable,Cloneable {
Entry<Vector2, Integer> 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));
}

View File

@ -132,6 +132,11 @@ public class Insufler100 extends Transmuter {
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() {

View File

@ -133,6 +133,11 @@ public class Insufler33 extends Transmuter {
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() {

View File

@ -132,6 +132,11 @@ public class Insufler50 extends Transmuter {
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() {

View File

@ -115,6 +115,11 @@ public class Inverter_I extends Transmuter {
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() {

View File

@ -114,6 +114,11 @@ public class Inverter_II extends Transmuter {
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() {

View File

@ -115,6 +115,11 @@ public class Negativer extends Transmuter {
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() {

View File

@ -117,6 +117,11 @@ public class Negativer_I extends Transmuter {
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() {

View File

@ -117,6 +117,11 @@ public class Negativer_II extends Transmuter {
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() {

View File

@ -115,6 +115,11 @@ public class Negativer_III extends Transmuter {
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() {

View File

@ -115,6 +115,11 @@ public class Neutraliser_I extends Transmuter {
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() {

View File

@ -115,6 +115,11 @@ public class Neutraliser_II extends Transmuter {
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() {

View File

@ -116,6 +116,11 @@ public class Oneway extends Transmuter {
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() {

View File

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

View File

@ -115,6 +115,11 @@ public class Positiver extends Transmuter {
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() {

View File

@ -117,6 +117,11 @@ public class Positiver_I extends Transmuter {
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() {

View File

@ -117,6 +117,11 @@ public class Positiver_II extends Transmuter {
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() {

View File

@ -114,6 +114,11 @@ public class Positiver_III extends Transmuter {
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() {

View File

@ -93,6 +93,9 @@ public abstract class Transmuter implements Cloneable, Serializable {
public void Activate() {
}
public void Unactivate() {
}
public void UpgradeTemp() {
}

View File

@ -123,6 +123,10 @@ public class distributor extends Transmuter {
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() {