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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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