feat: ajout de 5 transmuteurs, terminant les filtres...
This commit is contained in:
parent
c30821db91
commit
073a877c59
|
@ -271,6 +271,11 @@ public class Menu extends Actor {
|
||||||
this.setMenuTransmuter(1, 6, "=-",Angular.A90,0);
|
this.setMenuTransmuter(1, 6, "=-",Angular.A90,0);
|
||||||
this.setMenuTransmuter(2, 6, "=!",Angular.A90,0);
|
this.setMenuTransmuter(2, 6, "=!",Angular.A90,0);
|
||||||
this.setMenuTransmuter(3, 6, "=E",Angular.A90,0);
|
this.setMenuTransmuter(3, 6, "=E",Angular.A90,0);
|
||||||
|
this.setMenuTransmuter(1, 4, "=1",Angular.A00,0);
|
||||||
|
this.setMenuTransmuter(1, 3, "=2",Angular.A00,0);
|
||||||
|
this.setMenuTransmuter(1, 2, "=4",Angular.A00,0);
|
||||||
|
this.setMenuTransmuter(1, 7, "=4a",Angular.A00,1);
|
||||||
|
this.setMenuTransmuter(1, 6, "=8a",Angular.A00,1);
|
||||||
this.unSelect();
|
this.unSelect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,11 @@ import com.badlogic.gdx.utils.viewport.ScalingViewport;
|
||||||
import com.badlogic.gdx.utils.viewport.StretchViewport;
|
import com.badlogic.gdx.utils.viewport.StretchViewport;
|
||||||
import com.badlogic.gdx.Application;
|
import com.badlogic.gdx.Application;
|
||||||
|
|
||||||
|
import fr.evolving.automata.Filter1;
|
||||||
|
import fr.evolving.automata.Filter2;
|
||||||
|
import fr.evolving.automata.Filter4;
|
||||||
|
import fr.evolving.automata.Filter4Activable;
|
||||||
|
import fr.evolving.automata.Filter8Activable;
|
||||||
import fr.evolving.automata.FilterActivable;
|
import fr.evolving.automata.FilterActivable;
|
||||||
import fr.evolving.automata.FilterBig;
|
import fr.evolving.automata.FilterBig;
|
||||||
import fr.evolving.automata.FilterNegative;
|
import fr.evolving.automata.FilterNegative;
|
||||||
|
@ -207,6 +212,11 @@ public class AssetLoader {
|
||||||
allTransmuter.add(new FilterNegative(null));
|
allTransmuter.add(new FilterNegative(null));
|
||||||
allTransmuter.add(new FilterBig(null));
|
allTransmuter.add(new FilterBig(null));
|
||||||
allTransmuter.add(new FilterActivable(null));
|
allTransmuter.add(new FilterActivable(null));
|
||||||
|
allTransmuter.add(new Filter1(null));
|
||||||
|
allTransmuter.add(new Filter2(null));
|
||||||
|
allTransmuter.add(new Filter4(null));
|
||||||
|
allTransmuter.add(new Filter4Activable(null));
|
||||||
|
allTransmuter.add(new Filter8Activable(null));
|
||||||
for (Transmuter transmuter : allTransmuter) {
|
for (Transmuter transmuter : allTransmuter) {
|
||||||
Values<Integer> allTiles = transmuter.getTilesid().iterator();
|
Values<Integer> allTiles = transmuter.getTilesid().iterator();
|
||||||
while (allTiles.hasNext()) {
|
while (allTiles.hasNext()) {
|
||||||
|
|
|
@ -0,0 +1,285 @@
|
||||||
|
package fr.evolving.automata;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.automata.Transmuter.CaseType;
|
||||||
|
import fr.evolving.automata.Transmuter.Class;
|
||||||
|
|
||||||
|
public class Filter1 extends Transmuter {
|
||||||
|
private static String Name, Desc;
|
||||||
|
private static Class theClass;
|
||||||
|
private static int Price;
|
||||||
|
private static int Technology;
|
||||||
|
private static int Research;
|
||||||
|
private static Transmuter Upgrade;
|
||||||
|
private static Array<Transmuter> Unlock;
|
||||||
|
private static boolean showed;
|
||||||
|
private static boolean CanUpgradeTemp;
|
||||||
|
private static boolean CanUpgradeCycle;
|
||||||
|
private static boolean CanUpgradeRayon;
|
||||||
|
private static boolean CanUpgradeNrj;
|
||||||
|
private static float UpgradedTemp;
|
||||||
|
private static float UpgradedCycle;
|
||||||
|
private static float UpgradedRayon;
|
||||||
|
private static float UpgradedNrj;
|
||||||
|
private static float UsedTemp;
|
||||||
|
private static float UsedRayon;
|
||||||
|
private static float UsedNrj;
|
||||||
|
private static float TurnTemp;
|
||||||
|
private static float TurnRayon;
|
||||||
|
private static float TurnNrj;
|
||||||
|
private static boolean Activable;
|
||||||
|
private transient int ActivationLevel;
|
||||||
|
private static String id;
|
||||||
|
private static OrderedMap<Vector2, CaseType> Tilestype;
|
||||||
|
private static OrderedMap<Vector2, Integer> Tilesid;
|
||||||
|
|
||||||
|
public Filter1(Level level) {
|
||||||
|
super(level);
|
||||||
|
this.id="=1";
|
||||||
|
this.Name = AssetLoader.language.get("[filter1-name]");
|
||||||
|
this.Desc = AssetLoader.language.get("[filter1-desc]");
|
||||||
|
this.theClass = Class.Filtrage;
|
||||||
|
this.Price = 250;
|
||||||
|
this.Technology = 8;
|
||||||
|
this.Research = 0;
|
||||||
|
this.Upgrade = null;
|
||||||
|
this.Unlock = new Array<Transmuter>();
|
||||||
|
this.Unlock.add(new Filter2(level));
|
||||||
|
this.Unlock.add(new Filter4(level));
|
||||||
|
this.showed = true;
|
||||||
|
this.CanUpgradeTemp = true;
|
||||||
|
this.CanUpgradeCycle = false;
|
||||||
|
this.CanUpgradeRayon = false;
|
||||||
|
this.CanUpgradeNrj = false;
|
||||||
|
this.UpgradedTemp = 1f;
|
||||||
|
this.UpgradedCycle = 1f;
|
||||||
|
this.UpgradedRayon = 1f;
|
||||||
|
this.UpgradedNrj = 1f;
|
||||||
|
this.UsedTemp = 0.2f;
|
||||||
|
this.UsedRayon = 0f;
|
||||||
|
this.UsedNrj = 0f;
|
||||||
|
this.TurnTemp = 0f;
|
||||||
|
this.TurnRayon = 0f;
|
||||||
|
this.TurnNrj = 0f;
|
||||||
|
this.Activable = false;
|
||||||
|
this.ActivationLevel = 0;
|
||||||
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre);
|
||||||
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
|
this.Tilesid.put(new Vector2(1, 0), 160);
|
||||||
|
this.Tilesid.put(new Vector2(-1, 0), 159);
|
||||||
|
this.Tilesid.put(new Vector2(0, 0), 155);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getID() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return this.Desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Class getaClass() {
|
||||||
|
return this.theClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void savestatic() {
|
||||||
|
SetTemp(showed,UpgradedCycle,UpgradedTemp,UpgradedRayon,UpgradedNrj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void restorestatic() {
|
||||||
|
this.UpgradedTemp = this.temp_UpgradedTemp;
|
||||||
|
this.UpgradedCycle = this.temp_UpgradedCycle;
|
||||||
|
this.UpgradedRayon = this.temp_UpgradedRayon;
|
||||||
|
this.UpgradedNrj = this.temp_UpgradedNrj;
|
||||||
|
this.showed=this.temp_showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProcessCycle() {
|
||||||
|
this.level.Temp += TurnTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += TurnRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += TurnNrj * UpgradedNrj;
|
||||||
|
if (this.Activable)
|
||||||
|
this.ActivationLevel -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Run() {
|
||||||
|
this.level.Temp += UsedTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += UsedRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Activate() {
|
||||||
|
if (this.Activable)
|
||||||
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeTemp() {
|
||||||
|
if (isUpgradableTemp())
|
||||||
|
UpgradedTemp += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeNrj() {
|
||||||
|
if (isUpgradableNrj())
|
||||||
|
UpgradedNrj += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeRayon() {
|
||||||
|
if (isUpgradableRayon())
|
||||||
|
UpgradedRayon += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeCycle() {
|
||||||
|
if (isUpgradableCycle())
|
||||||
|
UpgradedCycle += 0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Values<Integer> getTilesid() {
|
||||||
|
return Tilesid.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CaseType getTilestype(int order) {
|
||||||
|
return Tilestype.values().toArray().get(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderedMap<Vector2, Integer> getTilesidrotated() {
|
||||||
|
OrderedMap<Vector2, Integer> newTiles = new OrderedMap<Vector2, Integer>();
|
||||||
|
Iterator<Vector2> tiles = this.Tilesid.keys();
|
||||||
|
while (tiles.hasNext()) {
|
||||||
|
Vector2 key = tiles.next();
|
||||||
|
double delta = key.len();
|
||||||
|
double alpha = key.angleRad() + this.getRotation().ordinal()
|
||||||
|
* Math.PI / 2;
|
||||||
|
newTiles.put(
|
||||||
|
new Vector2((float) Math.round(delta * Math.cos(alpha)),
|
||||||
|
(float) Math.round(delta * Math.sin(alpha))),
|
||||||
|
this.Tilesid.get(key));
|
||||||
|
}
|
||||||
|
return newTiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivable() {
|
||||||
|
return this.Activable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxActivationLevel() {
|
||||||
|
return ActivationLevel = (int) (10 * this.UpgradedCycle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActivationLevel() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getActivation() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel > 0;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrice() {
|
||||||
|
return Price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return (Tilesid.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTechnology() {
|
||||||
|
return Technology;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getResearch() {
|
||||||
|
return Research;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowed() {
|
||||||
|
return this.showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetShowed(boolean value) {
|
||||||
|
this.showed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableTemp() {
|
||||||
|
return CanUpgradeTemp && getUpgradeTemp() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableCycle() {
|
||||||
|
return CanUpgradeCycle && getUpgradeCycle() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableRayon() {
|
||||||
|
return CanUpgradeRayon && getUpgradeRayon() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableNrj() {
|
||||||
|
return CanUpgradeNrj && getUpgradeNrj() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeTemp() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedTemp - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeCycle() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedCycle - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeRayon() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedRayon - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeNrj() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedNrj - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedTemp() {
|
||||||
|
return UsedTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedRayon() {
|
||||||
|
return UsedRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedNrj() {
|
||||||
|
return UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnTemp() {
|
||||||
|
return TurnTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnRayon() {
|
||||||
|
return TurnRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnNrj() {
|
||||||
|
return TurnNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Transmuter getUpgrade() {
|
||||||
|
return this.Upgrade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Array<Transmuter> getUnlock() {
|
||||||
|
return this.Unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,284 @@
|
||||||
|
package fr.evolving.automata;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.automata.Transmuter.CaseType;
|
||||||
|
import fr.evolving.automata.Transmuter.Class;
|
||||||
|
|
||||||
|
public class Filter2 extends Transmuter {
|
||||||
|
private static String Name, Desc;
|
||||||
|
private static Class theClass;
|
||||||
|
private static int Price;
|
||||||
|
private static int Technology;
|
||||||
|
private static int Research;
|
||||||
|
private static Transmuter Upgrade;
|
||||||
|
private static Array<Transmuter> Unlock;
|
||||||
|
private static boolean showed;
|
||||||
|
private static boolean CanUpgradeTemp;
|
||||||
|
private static boolean CanUpgradeCycle;
|
||||||
|
private static boolean CanUpgradeRayon;
|
||||||
|
private static boolean CanUpgradeNrj;
|
||||||
|
private static float UpgradedTemp;
|
||||||
|
private static float UpgradedCycle;
|
||||||
|
private static float UpgradedRayon;
|
||||||
|
private static float UpgradedNrj;
|
||||||
|
private static float UsedTemp;
|
||||||
|
private static float UsedRayon;
|
||||||
|
private static float UsedNrj;
|
||||||
|
private static float TurnTemp;
|
||||||
|
private static float TurnRayon;
|
||||||
|
private static float TurnNrj;
|
||||||
|
private static boolean Activable;
|
||||||
|
private transient int ActivationLevel;
|
||||||
|
private static String id;
|
||||||
|
private static OrderedMap<Vector2, CaseType> Tilestype;
|
||||||
|
private static OrderedMap<Vector2, Integer> Tilesid;
|
||||||
|
|
||||||
|
public Filter2(Level level) {
|
||||||
|
super(level);
|
||||||
|
this.id="=2";
|
||||||
|
this.Name = AssetLoader.language.get("[filter2-name]");
|
||||||
|
this.Desc = AssetLoader.language.get("[filter2-desc]");
|
||||||
|
this.theClass = Class.Filtrage;
|
||||||
|
this.Price = 275;
|
||||||
|
this.Technology = 8;
|
||||||
|
this.Research = 150;
|
||||||
|
this.Upgrade = null;
|
||||||
|
this.Unlock = new Array<Transmuter>();
|
||||||
|
this.Unlock.add(new Filter4(level));
|
||||||
|
this.showed = false;
|
||||||
|
this.CanUpgradeTemp = true;
|
||||||
|
this.CanUpgradeCycle = false;
|
||||||
|
this.CanUpgradeRayon = false;
|
||||||
|
this.CanUpgradeNrj = false;
|
||||||
|
this.UpgradedTemp = 1f;
|
||||||
|
this.UpgradedCycle = 1f;
|
||||||
|
this.UpgradedRayon = 1f;
|
||||||
|
this.UpgradedNrj = 1f;
|
||||||
|
this.UsedTemp = 0.2f;
|
||||||
|
this.UsedRayon = 0f;
|
||||||
|
this.UsedNrj = 0f;
|
||||||
|
this.TurnTemp = 0f;
|
||||||
|
this.TurnRayon = 0f;
|
||||||
|
this.TurnNrj = 0f;
|
||||||
|
this.Activable = false;
|
||||||
|
this.ActivationLevel = 0;
|
||||||
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre);
|
||||||
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
|
this.Tilesid.put(new Vector2(1, 0), 162);
|
||||||
|
this.Tilesid.put(new Vector2(-1, 0), 161);
|
||||||
|
this.Tilesid.put(new Vector2(0, 0), 156);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getID() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return this.Desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Class getaClass() {
|
||||||
|
return this.theClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void savestatic() {
|
||||||
|
SetTemp(showed,UpgradedCycle,UpgradedTemp,UpgradedRayon,UpgradedNrj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void restorestatic() {
|
||||||
|
this.UpgradedTemp = this.temp_UpgradedTemp;
|
||||||
|
this.UpgradedCycle = this.temp_UpgradedCycle;
|
||||||
|
this.UpgradedRayon = this.temp_UpgradedRayon;
|
||||||
|
this.UpgradedNrj = this.temp_UpgradedNrj;
|
||||||
|
this.showed=this.temp_showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProcessCycle() {
|
||||||
|
this.level.Temp += TurnTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += TurnRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += TurnNrj * UpgradedNrj;
|
||||||
|
if (this.Activable)
|
||||||
|
this.ActivationLevel -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Run() {
|
||||||
|
this.level.Temp += UsedTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += UsedRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Activate() {
|
||||||
|
if (this.Activable)
|
||||||
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeTemp() {
|
||||||
|
if (isUpgradableTemp())
|
||||||
|
UpgradedTemp += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeNrj() {
|
||||||
|
if (isUpgradableNrj())
|
||||||
|
UpgradedNrj += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeRayon() {
|
||||||
|
if (isUpgradableRayon())
|
||||||
|
UpgradedRayon += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeCycle() {
|
||||||
|
if (isUpgradableCycle())
|
||||||
|
UpgradedCycle += 0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Values<Integer> getTilesid() {
|
||||||
|
return Tilesid.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CaseType getTilestype(int order) {
|
||||||
|
return Tilestype.values().toArray().get(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderedMap<Vector2, Integer> getTilesidrotated() {
|
||||||
|
OrderedMap<Vector2, Integer> newTiles = new OrderedMap<Vector2, Integer>();
|
||||||
|
Iterator<Vector2> tiles = this.Tilesid.keys();
|
||||||
|
while (tiles.hasNext()) {
|
||||||
|
Vector2 key = tiles.next();
|
||||||
|
double delta = key.len();
|
||||||
|
double alpha = key.angleRad() + this.getRotation().ordinal()
|
||||||
|
* Math.PI / 2;
|
||||||
|
newTiles.put(
|
||||||
|
new Vector2((float) Math.round(delta * Math.cos(alpha)),
|
||||||
|
(float) Math.round(delta * Math.sin(alpha))),
|
||||||
|
this.Tilesid.get(key));
|
||||||
|
}
|
||||||
|
return newTiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivable() {
|
||||||
|
return this.Activable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxActivationLevel() {
|
||||||
|
return ActivationLevel = (int) (10 * this.UpgradedCycle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActivationLevel() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getActivation() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel > 0;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrice() {
|
||||||
|
return Price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return (Tilesid.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTechnology() {
|
||||||
|
return Technology;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getResearch() {
|
||||||
|
return Research;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowed() {
|
||||||
|
return this.showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetShowed(boolean value) {
|
||||||
|
this.showed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableTemp() {
|
||||||
|
return CanUpgradeTemp && getUpgradeTemp() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableCycle() {
|
||||||
|
return CanUpgradeCycle && getUpgradeCycle() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableRayon() {
|
||||||
|
return CanUpgradeRayon && getUpgradeRayon() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableNrj() {
|
||||||
|
return CanUpgradeNrj && getUpgradeNrj() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeTemp() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedTemp - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeCycle() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedCycle - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeRayon() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedRayon - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeNrj() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedNrj - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedTemp() {
|
||||||
|
return UsedTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedRayon() {
|
||||||
|
return UsedRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedNrj() {
|
||||||
|
return UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnTemp() {
|
||||||
|
return TurnTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnRayon() {
|
||||||
|
return TurnRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnNrj() {
|
||||||
|
return TurnNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Transmuter getUpgrade() {
|
||||||
|
return this.Upgrade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Array<Transmuter> getUnlock() {
|
||||||
|
return this.Unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,283 @@
|
||||||
|
package fr.evolving.automata;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.automata.Transmuter.CaseType;
|
||||||
|
import fr.evolving.automata.Transmuter.Class;
|
||||||
|
|
||||||
|
public class Filter4 extends Transmuter {
|
||||||
|
private static String Name, Desc;
|
||||||
|
private static Class theClass;
|
||||||
|
private static int Price;
|
||||||
|
private static int Technology;
|
||||||
|
private static int Research;
|
||||||
|
private static Transmuter Upgrade;
|
||||||
|
private static Array<Transmuter> Unlock;
|
||||||
|
private static boolean showed;
|
||||||
|
private static boolean CanUpgradeTemp;
|
||||||
|
private static boolean CanUpgradeCycle;
|
||||||
|
private static boolean CanUpgradeRayon;
|
||||||
|
private static boolean CanUpgradeNrj;
|
||||||
|
private static float UpgradedTemp;
|
||||||
|
private static float UpgradedCycle;
|
||||||
|
private static float UpgradedRayon;
|
||||||
|
private static float UpgradedNrj;
|
||||||
|
private static float UsedTemp;
|
||||||
|
private static float UsedRayon;
|
||||||
|
private static float UsedNrj;
|
||||||
|
private static float TurnTemp;
|
||||||
|
private static float TurnRayon;
|
||||||
|
private static float TurnNrj;
|
||||||
|
private static boolean Activable;
|
||||||
|
private transient int ActivationLevel;
|
||||||
|
private static String id;
|
||||||
|
private static OrderedMap<Vector2, CaseType> Tilestype;
|
||||||
|
private static OrderedMap<Vector2, Integer> Tilesid;
|
||||||
|
|
||||||
|
public Filter4(Level level) {
|
||||||
|
super(level);
|
||||||
|
this.id="=4";
|
||||||
|
this.Name = AssetLoader.language.get("[filter4-name]");
|
||||||
|
this.Desc = AssetLoader.language.get("[filter4-desc]");
|
||||||
|
this.theClass = Class.Filtrage;
|
||||||
|
this.Price = 300;
|
||||||
|
this.Technology = 8;
|
||||||
|
this.Research = 300;
|
||||||
|
this.Upgrade = null;
|
||||||
|
this.Unlock = null;
|
||||||
|
this.showed = false;
|
||||||
|
this.CanUpgradeTemp = true;
|
||||||
|
this.CanUpgradeCycle = false;
|
||||||
|
this.CanUpgradeRayon = false;
|
||||||
|
this.CanUpgradeNrj = false;
|
||||||
|
this.UpgradedTemp = 1f;
|
||||||
|
this.UpgradedCycle = 1f;
|
||||||
|
this.UpgradedRayon = 1f;
|
||||||
|
this.UpgradedNrj = 1f;
|
||||||
|
this.UsedTemp = 0.2f;
|
||||||
|
this.UsedRayon = 0f;
|
||||||
|
this.UsedNrj = 0f;
|
||||||
|
this.TurnTemp = 0f;
|
||||||
|
this.TurnRayon = 0f;
|
||||||
|
this.TurnNrj = 0f;
|
||||||
|
this.Activable = false;
|
||||||
|
this.ActivationLevel = 0;
|
||||||
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre);
|
||||||
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
|
this.Tilesid.put(new Vector2(1, 0), 164);
|
||||||
|
this.Tilesid.put(new Vector2(-1, 0), 163);
|
||||||
|
this.Tilesid.put(new Vector2(0, 0), 158);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getID() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return this.Desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Class getaClass() {
|
||||||
|
return this.theClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void savestatic() {
|
||||||
|
SetTemp(showed,UpgradedCycle,UpgradedTemp,UpgradedRayon,UpgradedNrj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void restorestatic() {
|
||||||
|
this.UpgradedTemp = this.temp_UpgradedTemp;
|
||||||
|
this.UpgradedCycle = this.temp_UpgradedCycle;
|
||||||
|
this.UpgradedRayon = this.temp_UpgradedRayon;
|
||||||
|
this.UpgradedNrj = this.temp_UpgradedNrj;
|
||||||
|
this.showed=this.temp_showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProcessCycle() {
|
||||||
|
this.level.Temp += TurnTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += TurnRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += TurnNrj * UpgradedNrj;
|
||||||
|
if (this.Activable)
|
||||||
|
this.ActivationLevel -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Run() {
|
||||||
|
this.level.Temp += UsedTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += UsedRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Activate() {
|
||||||
|
if (this.Activable)
|
||||||
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeTemp() {
|
||||||
|
if (isUpgradableTemp())
|
||||||
|
UpgradedTemp += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeNrj() {
|
||||||
|
if (isUpgradableNrj())
|
||||||
|
UpgradedNrj += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeRayon() {
|
||||||
|
if (isUpgradableRayon())
|
||||||
|
UpgradedRayon += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeCycle() {
|
||||||
|
if (isUpgradableCycle())
|
||||||
|
UpgradedCycle += 0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Values<Integer> getTilesid() {
|
||||||
|
return Tilesid.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CaseType getTilestype(int order) {
|
||||||
|
return Tilestype.values().toArray().get(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderedMap<Vector2, Integer> getTilesidrotated() {
|
||||||
|
OrderedMap<Vector2, Integer> newTiles = new OrderedMap<Vector2, Integer>();
|
||||||
|
Iterator<Vector2> tiles = this.Tilesid.keys();
|
||||||
|
while (tiles.hasNext()) {
|
||||||
|
Vector2 key = tiles.next();
|
||||||
|
double delta = key.len();
|
||||||
|
double alpha = key.angleRad() + this.getRotation().ordinal()
|
||||||
|
* Math.PI / 2;
|
||||||
|
newTiles.put(
|
||||||
|
new Vector2((float) Math.round(delta * Math.cos(alpha)),
|
||||||
|
(float) Math.round(delta * Math.sin(alpha))),
|
||||||
|
this.Tilesid.get(key));
|
||||||
|
}
|
||||||
|
return newTiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivable() {
|
||||||
|
return this.Activable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxActivationLevel() {
|
||||||
|
return ActivationLevel = (int) (10 * this.UpgradedCycle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActivationLevel() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getActivation() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel > 0;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrice() {
|
||||||
|
return Price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return (Tilesid.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTechnology() {
|
||||||
|
return Technology;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getResearch() {
|
||||||
|
return Research;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowed() {
|
||||||
|
return this.showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetShowed(boolean value) {
|
||||||
|
this.showed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableTemp() {
|
||||||
|
return CanUpgradeTemp && getUpgradeTemp() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableCycle() {
|
||||||
|
return CanUpgradeCycle && getUpgradeCycle() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableRayon() {
|
||||||
|
return CanUpgradeRayon && getUpgradeRayon() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableNrj() {
|
||||||
|
return CanUpgradeNrj && getUpgradeNrj() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeTemp() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedTemp - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeCycle() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedCycle - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeRayon() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedRayon - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeNrj() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedNrj - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedTemp() {
|
||||||
|
return UsedTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedRayon() {
|
||||||
|
return UsedRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedNrj() {
|
||||||
|
return UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnTemp() {
|
||||||
|
return TurnTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnRayon() {
|
||||||
|
return TurnRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnNrj() {
|
||||||
|
return TurnNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Transmuter getUpgrade() {
|
||||||
|
return this.Upgrade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Array<Transmuter> getUnlock() {
|
||||||
|
return this.Unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,284 @@
|
||||||
|
package fr.evolving.automata;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.automata.Transmuter.CaseType;
|
||||||
|
import fr.evolving.automata.Transmuter.Class;
|
||||||
|
|
||||||
|
public class Filter4Activable extends Transmuter {
|
||||||
|
private static String Name, Desc;
|
||||||
|
private static Class theClass;
|
||||||
|
private static int Price;
|
||||||
|
private static int Technology;
|
||||||
|
private static int Research;
|
||||||
|
private static Transmuter Upgrade;
|
||||||
|
private static Array<Transmuter> Unlock;
|
||||||
|
private static boolean showed;
|
||||||
|
private static boolean CanUpgradeTemp;
|
||||||
|
private static boolean CanUpgradeCycle;
|
||||||
|
private static boolean CanUpgradeRayon;
|
||||||
|
private static boolean CanUpgradeNrj;
|
||||||
|
private static float UpgradedTemp;
|
||||||
|
private static float UpgradedCycle;
|
||||||
|
private static float UpgradedRayon;
|
||||||
|
private static float UpgradedNrj;
|
||||||
|
private static float UsedTemp;
|
||||||
|
private static float UsedRayon;
|
||||||
|
private static float UsedNrj;
|
||||||
|
private static float TurnTemp;
|
||||||
|
private static float TurnRayon;
|
||||||
|
private static float TurnNrj;
|
||||||
|
private static boolean Activable;
|
||||||
|
private transient int ActivationLevel;
|
||||||
|
private static String id;
|
||||||
|
private static OrderedMap<Vector2, CaseType> Tilestype;
|
||||||
|
private static OrderedMap<Vector2, Integer> Tilesid;
|
||||||
|
|
||||||
|
public Filter4Activable(Level level) {
|
||||||
|
super(level);
|
||||||
|
this.id="=4a";
|
||||||
|
this.Name = AssetLoader.language.get("[filter4activable-name]");
|
||||||
|
this.Desc = AssetLoader.language.get("[filter4activable-desc]");
|
||||||
|
this.theClass = Class.Filtrage;
|
||||||
|
this.Price = 350;
|
||||||
|
this.Technology = 9;
|
||||||
|
this.Research = 0;
|
||||||
|
this.Upgrade = null;
|
||||||
|
this.Unlock = new Array<Transmuter>();
|
||||||
|
this.Unlock.add(new Filter8Activable(level));
|
||||||
|
this.showed = true;
|
||||||
|
this.CanUpgradeTemp = true;
|
||||||
|
this.CanUpgradeCycle = true;
|
||||||
|
this.CanUpgradeRayon = false;
|
||||||
|
this.CanUpgradeNrj = false;
|
||||||
|
this.UpgradedTemp = 1f;
|
||||||
|
this.UpgradedCycle = 1f;
|
||||||
|
this.UpgradedRayon = 1f;
|
||||||
|
this.UpgradedNrj = 1f;
|
||||||
|
this.UsedTemp = 0.2f;
|
||||||
|
this.UsedRayon = 0f;
|
||||||
|
this.UsedNrj = 0f;
|
||||||
|
this.TurnTemp = 0f;
|
||||||
|
this.TurnRayon = 0f;
|
||||||
|
this.TurnNrj = 0f;
|
||||||
|
this.Activable = true;
|
||||||
|
this.ActivationLevel = 0;
|
||||||
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Tout);
|
||||||
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
|
this.Tilesid.put(new Vector2(1, 0), 164);
|
||||||
|
this.Tilesid.put(new Vector2(-1, 0), 163);
|
||||||
|
this.Tilesid.put(new Vector2(0, 0), 171);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getID() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return this.Desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Class getaClass() {
|
||||||
|
return this.theClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void savestatic() {
|
||||||
|
SetTemp(showed,UpgradedCycle,UpgradedTemp,UpgradedRayon,UpgradedNrj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void restorestatic() {
|
||||||
|
this.UpgradedTemp = this.temp_UpgradedTemp;
|
||||||
|
this.UpgradedCycle = this.temp_UpgradedCycle;
|
||||||
|
this.UpgradedRayon = this.temp_UpgradedRayon;
|
||||||
|
this.UpgradedNrj = this.temp_UpgradedNrj;
|
||||||
|
this.showed=this.temp_showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProcessCycle() {
|
||||||
|
this.level.Temp += TurnTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += TurnRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += TurnNrj * UpgradedNrj;
|
||||||
|
if (this.Activable)
|
||||||
|
this.ActivationLevel -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Run() {
|
||||||
|
this.level.Temp += UsedTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += UsedRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Activate() {
|
||||||
|
if (this.Activable)
|
||||||
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeTemp() {
|
||||||
|
if (isUpgradableTemp())
|
||||||
|
UpgradedTemp += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeNrj() {
|
||||||
|
if (isUpgradableNrj())
|
||||||
|
UpgradedNrj += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeRayon() {
|
||||||
|
if (isUpgradableRayon())
|
||||||
|
UpgradedRayon += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeCycle() {
|
||||||
|
if (isUpgradableCycle())
|
||||||
|
UpgradedCycle += 0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Values<Integer> getTilesid() {
|
||||||
|
return Tilesid.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CaseType getTilestype(int order) {
|
||||||
|
return Tilestype.values().toArray().get(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderedMap<Vector2, Integer> getTilesidrotated() {
|
||||||
|
OrderedMap<Vector2, Integer> newTiles = new OrderedMap<Vector2, Integer>();
|
||||||
|
Iterator<Vector2> tiles = this.Tilesid.keys();
|
||||||
|
while (tiles.hasNext()) {
|
||||||
|
Vector2 key = tiles.next();
|
||||||
|
double delta = key.len();
|
||||||
|
double alpha = key.angleRad() + this.getRotation().ordinal()
|
||||||
|
* Math.PI / 2;
|
||||||
|
newTiles.put(
|
||||||
|
new Vector2((float) Math.round(delta * Math.cos(alpha)),
|
||||||
|
(float) Math.round(delta * Math.sin(alpha))),
|
||||||
|
this.Tilesid.get(key));
|
||||||
|
}
|
||||||
|
return newTiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivable() {
|
||||||
|
return this.Activable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxActivationLevel() {
|
||||||
|
return ActivationLevel = (int) (10 * this.UpgradedCycle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActivationLevel() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getActivation() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel > 0;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrice() {
|
||||||
|
return Price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return (Tilesid.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTechnology() {
|
||||||
|
return Technology;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getResearch() {
|
||||||
|
return Research;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowed() {
|
||||||
|
return this.showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetShowed(boolean value) {
|
||||||
|
this.showed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableTemp() {
|
||||||
|
return CanUpgradeTemp && getUpgradeTemp() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableCycle() {
|
||||||
|
return CanUpgradeCycle && getUpgradeCycle() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableRayon() {
|
||||||
|
return CanUpgradeRayon && getUpgradeRayon() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableNrj() {
|
||||||
|
return CanUpgradeNrj && getUpgradeNrj() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeTemp() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedTemp - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeCycle() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedCycle - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeRayon() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedRayon - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeNrj() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedNrj - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedTemp() {
|
||||||
|
return UsedTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedRayon() {
|
||||||
|
return UsedRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedNrj() {
|
||||||
|
return UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnTemp() {
|
||||||
|
return TurnTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnRayon() {
|
||||||
|
return TurnRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnNrj() {
|
||||||
|
return TurnNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Transmuter getUpgrade() {
|
||||||
|
return this.Upgrade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Array<Transmuter> getUnlock() {
|
||||||
|
return this.Unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,283 @@
|
||||||
|
package fr.evolving.automata;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.automata.Transmuter.CaseType;
|
||||||
|
import fr.evolving.automata.Transmuter.Class;
|
||||||
|
|
||||||
|
public class Filter8Activable extends Transmuter {
|
||||||
|
private static String Name, Desc;
|
||||||
|
private static Class theClass;
|
||||||
|
private static int Price;
|
||||||
|
private static int Technology;
|
||||||
|
private static int Research;
|
||||||
|
private static Transmuter Upgrade;
|
||||||
|
private static Array<Transmuter> Unlock;
|
||||||
|
private static boolean showed;
|
||||||
|
private static boolean CanUpgradeTemp;
|
||||||
|
private static boolean CanUpgradeCycle;
|
||||||
|
private static boolean CanUpgradeRayon;
|
||||||
|
private static boolean CanUpgradeNrj;
|
||||||
|
private static float UpgradedTemp;
|
||||||
|
private static float UpgradedCycle;
|
||||||
|
private static float UpgradedRayon;
|
||||||
|
private static float UpgradedNrj;
|
||||||
|
private static float UsedTemp;
|
||||||
|
private static float UsedRayon;
|
||||||
|
private static float UsedNrj;
|
||||||
|
private static float TurnTemp;
|
||||||
|
private static float TurnRayon;
|
||||||
|
private static float TurnNrj;
|
||||||
|
private static boolean Activable;
|
||||||
|
private transient int ActivationLevel;
|
||||||
|
private static String id;
|
||||||
|
private static OrderedMap<Vector2, CaseType> Tilestype;
|
||||||
|
private static OrderedMap<Vector2, Integer> Tilesid;
|
||||||
|
|
||||||
|
public Filter8Activable(Level level) {
|
||||||
|
super(level);
|
||||||
|
this.id="=8a";
|
||||||
|
this.Name = AssetLoader.language.get("[filter8activable-name]");
|
||||||
|
this.Desc = AssetLoader.language.get("[filter8activable-desc]");
|
||||||
|
this.theClass = Class.Filtrage;
|
||||||
|
this.Price = 375;
|
||||||
|
this.Technology = 9;
|
||||||
|
this.Research = 500;
|
||||||
|
this.Upgrade = null;
|
||||||
|
this.Unlock = null;
|
||||||
|
this.showed = false;
|
||||||
|
this.CanUpgradeTemp = true;
|
||||||
|
this.CanUpgradeCycle = true;
|
||||||
|
this.CanUpgradeRayon = false;
|
||||||
|
this.CanUpgradeNrj = false;
|
||||||
|
this.UpgradedTemp = 1f;
|
||||||
|
this.UpgradedCycle = 1f;
|
||||||
|
this.UpgradedRayon = 1f;
|
||||||
|
this.UpgradedNrj = 1f;
|
||||||
|
this.UsedTemp = 0.2f;
|
||||||
|
this.UsedRayon = 0f;
|
||||||
|
this.UsedNrj = 0f;
|
||||||
|
this.TurnTemp = 0f;
|
||||||
|
this.TurnRayon = 0f;
|
||||||
|
this.TurnNrj = 0f;
|
||||||
|
this.Activable = true;
|
||||||
|
this.ActivationLevel = 0;
|
||||||
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
||||||
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Tout);
|
||||||
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
|
this.Tilesid.put(new Vector2(1, 0), 166);
|
||||||
|
this.Tilesid.put(new Vector2(-1, 0), 165);
|
||||||
|
this.Tilesid.put(new Vector2(0, 0), 175);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getID() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return this.Desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Class getaClass() {
|
||||||
|
return this.theClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void savestatic() {
|
||||||
|
SetTemp(showed,UpgradedCycle,UpgradedTemp,UpgradedRayon,UpgradedNrj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void restorestatic() {
|
||||||
|
this.UpgradedTemp = this.temp_UpgradedTemp;
|
||||||
|
this.UpgradedCycle = this.temp_UpgradedCycle;
|
||||||
|
this.UpgradedRayon = this.temp_UpgradedRayon;
|
||||||
|
this.UpgradedNrj = this.temp_UpgradedNrj;
|
||||||
|
this.showed=this.temp_showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProcessCycle() {
|
||||||
|
this.level.Temp += TurnTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += TurnRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += TurnNrj * UpgradedNrj;
|
||||||
|
if (this.Activable)
|
||||||
|
this.ActivationLevel -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Run() {
|
||||||
|
this.level.Temp += UsedTemp * UpgradedTemp;
|
||||||
|
this.level.Rayon += UsedRayon * UpgradedRayon;
|
||||||
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Activate() {
|
||||||
|
if (this.Activable)
|
||||||
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeTemp() {
|
||||||
|
if (isUpgradableTemp())
|
||||||
|
UpgradedTemp += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeNrj() {
|
||||||
|
if (isUpgradableNrj())
|
||||||
|
UpgradedNrj += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeRayon() {
|
||||||
|
if (isUpgradableRayon())
|
||||||
|
UpgradedRayon += -0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpgradeCycle() {
|
||||||
|
if (isUpgradableCycle())
|
||||||
|
UpgradedCycle += 0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Values<Integer> getTilesid() {
|
||||||
|
return Tilesid.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CaseType getTilestype(int order) {
|
||||||
|
return Tilestype.values().toArray().get(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderedMap<Vector2, Integer> getTilesidrotated() {
|
||||||
|
OrderedMap<Vector2, Integer> newTiles = new OrderedMap<Vector2, Integer>();
|
||||||
|
Iterator<Vector2> tiles = this.Tilesid.keys();
|
||||||
|
while (tiles.hasNext()) {
|
||||||
|
Vector2 key = tiles.next();
|
||||||
|
double delta = key.len();
|
||||||
|
double alpha = key.angleRad() + this.getRotation().ordinal()
|
||||||
|
* Math.PI / 2;
|
||||||
|
newTiles.put(
|
||||||
|
new Vector2((float) Math.round(delta * Math.cos(alpha)),
|
||||||
|
(float) Math.round(delta * Math.sin(alpha))),
|
||||||
|
this.Tilesid.get(key));
|
||||||
|
}
|
||||||
|
return newTiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivable() {
|
||||||
|
return this.Activable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxActivationLevel() {
|
||||||
|
return ActivationLevel = (int) (10 * this.UpgradedCycle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActivationLevel() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getActivation() {
|
||||||
|
if (this.Activable)
|
||||||
|
return ActivationLevel > 0;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrice() {
|
||||||
|
return Price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return (Tilesid.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTechnology() {
|
||||||
|
return Technology;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getResearch() {
|
||||||
|
return Research;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowed() {
|
||||||
|
return this.showed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetShowed(boolean value) {
|
||||||
|
this.showed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableTemp() {
|
||||||
|
return CanUpgradeTemp && getUpgradeTemp() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableCycle() {
|
||||||
|
return CanUpgradeCycle && getUpgradeCycle() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableRayon() {
|
||||||
|
return CanUpgradeRayon && getUpgradeRayon() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradableNrj() {
|
||||||
|
return CanUpgradeNrj && getUpgradeNrj() < 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeTemp() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedTemp - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeCycle() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedCycle - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeRayon() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedRayon - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeNrj() {
|
||||||
|
return Math.abs((int) ((10 * UpgradedNrj - 10) / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedTemp() {
|
||||||
|
return UsedTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedRayon() {
|
||||||
|
return UsedRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUsedNrj() {
|
||||||
|
return UsedNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnTemp() {
|
||||||
|
return TurnTemp * UpgradedTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnRayon() {
|
||||||
|
return TurnRayon * UpgradedRayon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getTurnNrj() {
|
||||||
|
return TurnNrj * UpgradedNrj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Transmuter getUpgrade() {
|
||||||
|
return this.Upgrade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Array<Transmuter> getUnlock() {
|
||||||
|
return this.Unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -50,6 +50,7 @@ public class Insufler33 extends Transmuter {
|
||||||
this.Research = 0;
|
this.Research = 0;
|
||||||
this.Upgrade = null;
|
this.Upgrade = null;
|
||||||
this.Unlock = new Array<Transmuter>();
|
this.Unlock = new Array<Transmuter>();
|
||||||
|
this.Unlock.add(new Insufler100(null));
|
||||||
this.Unlock.add(new Insufler50(null));
|
this.Unlock.add(new Insufler50(null));
|
||||||
this.showed = true;
|
this.showed = true;
|
||||||
this.CanUpgradeTemp = true;
|
this.CanUpgradeTemp = true;
|
||||||
|
|
|
@ -503,6 +503,7 @@ public class Worlds extends Actor {
|
||||||
|
|
||||||
public int getMaxWorlds() {
|
public int getMaxWorlds() {
|
||||||
int max = 0;
|
int max = 0;
|
||||||
|
if (levels!=null)
|
||||||
for (Level level : levels)
|
for (Level level : levels)
|
||||||
if (level != null && level.aWorld > max)
|
if (level != null && level.aWorld > max)
|
||||||
max = level.aWorld;
|
max = level.aWorld;
|
||||||
|
@ -530,6 +531,7 @@ public class Worlds extends Actor {
|
||||||
|
|
||||||
public int getMaxLevel(int world) {
|
public int getMaxLevel(int world) {
|
||||||
int max = 0;
|
int max = 0;
|
||||||
|
if (levels!=null)
|
||||||
for (Level level : levels)
|
for (Level level : levels)
|
||||||
if (level != null && level.aWorld == world && level.aLevel>max)
|
if (level != null && level.aWorld == world && level.aLevel>max)
|
||||||
max = level.aLevel;
|
max = level.aLevel;
|
||||||
|
|
|
@ -328,7 +328,11 @@ public class LevelScreen implements Screen {
|
||||||
else
|
else
|
||||||
selectnoone();
|
selectnoone();
|
||||||
if (worlds.getLevelData()==null)
|
if (worlds.getLevelData()==null)
|
||||||
selected=buttonLevels.first();
|
if (buttonLevels.size>0)
|
||||||
|
selectone();
|
||||||
|
else
|
||||||
|
selectnoone();
|
||||||
|
|
||||||
Previous.setVisible(!worlds.isFirstWorld());
|
Previous.setVisible(!worlds.isFirstWorld());
|
||||||
if (worlds.isDebug())
|
if (worlds.isDebug())
|
||||||
Next.setVisible(!worlds.isRealLastWorld());
|
Next.setVisible(!worlds.isRealLastWorld());
|
||||||
|
@ -951,6 +955,7 @@ public class LevelScreen implements Screen {
|
||||||
creater.addListener(new ClickListener() {
|
creater.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
if (worlds.isDebug() && addbutton.isChecked()) {
|
||||||
Level level=new Level(
|
Level level=new Level(
|
||||||
worlds.getWorld(),
|
worlds.getWorld(),
|
||||||
worlds.getFreeLevel(),
|
worlds.getFreeLevel(),
|
||||||
|
@ -962,6 +967,7 @@ public class LevelScreen implements Screen {
|
||||||
99999, 99999, "", false, new int[][] {{}});
|
99999, 99999, "", false, new int[][] {{}});
|
||||||
worlds.addLevel(level);
|
worlds.addLevel(level);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
temp_orig = new ImageTextButton("", AssetLoader.Skin_level, "temp");
|
temp_orig = new ImageTextButton("", AssetLoader.Skin_level, "temp");
|
||||||
temp_orig.setPosition(1665, 360);
|
temp_orig.setPosition(1665, 360);
|
||||||
|
|
Loading…
Reference in New Issue