Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya246 authored Mar 26, 2021
1 parent 27a41a6 commit b7dbaea
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions src/crawler_arena/CrawlerArenaMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class CrawlerArenaMod extends Plugin {

@Override
public void init(){
unitCostsBase.addAll(new int[]{200}, new int[]{200}, new int[]{325}, new int[]{75}, new int[]{400}, new int[]{1500}, new int[]{2750}, new int[]{1500}, new int[]{3000}, new int[]{1500}, new int[]{2500}, new int[]{15000}, new int[]{30000}, new int[]{30000}, new int[]{30000}, new int[]{175000}, new int[]{250000}, new int[]{325000}, new int[]{250000}, new int[]{4000000});
upgradeableUnits.addAll(UnitTypes.mace, UnitTypes.atrax, UnitTypes.pulsar, UnitTypes.flare, UnitTypes.risso, UnitTypes.fortress, UnitTypes.quasar, UnitTypes.spiroct, UnitTypes.zenith, UnitTypes.mega, UnitTypes.crawler, UnitTypes.vela, UnitTypes.scepter, UnitTypes.antumbra, UnitTypes.arkyid, UnitTypes.eclipse, UnitTypes.reign, UnitTypes.toxopid, UnitTypes.corvus, UnitTypes.omura);
unitCostsBase.addAll(new int[]{200}, new int[]{200}, new int[]{325}, new int[]{75}, new int[]{400}, new int[]{1500}, new int[]{2750}, new int[]{1500}, new int[]{3000}, new int[]{1500}, new int[]{2500}, new int[]{12000}, new int[]{15000}, new int[]{30000}, new int[]{30000}, new int[]{30000}, new int[]{40000}, new int[]{175000}, new int[]{250000}, new int[]{325000}, new int[]{250000}, new int[]{4000000});
upgradeableUnits.addAll(UnitTypes.mace, UnitTypes.atrax, UnitTypes.pulsar, UnitTypes.flare, UnitTypes.risso, UnitTypes.fortress, UnitTypes.quasar, UnitTypes.spiroct, UnitTypes.zenith, UnitTypes.mega, UnitTypes.crawler, UnitTypes.quad, UnitTypes.vela, UnitTypes.scepter, UnitTypes.antumbra, UnitTypes.arkyid, UnitTypes.sei, UnitTypes.eclipse, UnitTypes.reign, UnitTypes.toxopid, UnitTypes.corvus, UnitTypes.omura);
upgradeableUnits.each(u -> {
unitCosts.put(u, new int[]{unitCostsBase.get(0)[0]});
upgradeableUnitNames.put(u.name, u);
Expand All @@ -61,6 +61,7 @@ public void init(){
UnitTypes.omura.health = 35000;
UnitTypes.omura.armor = 20;
UnitTypes.risso.flying = true;
UnitTypes.sei.flying = true;
UnitTypes.fortress.health = 1200;
UnitTypes.crawler.defaultController = ArenaAI::new;
UnitTypes.fortress.armor = 20;
Expand Down Expand Up @@ -105,6 +106,8 @@ public void init(){
if(units.get(invader.uuid()) != null){
invader.unit(units.get(invader.uuid()));
};
}else{
rewritePlayers();
};
e.player.unit(oldUnit);
};
Expand Down Expand Up @@ -142,7 +145,7 @@ public void init(){
try{
Call.setHudText(p.con, "Money: " + String.valueOf(Mathf.round(money.get(p.uuid())[0])));
}catch(Exception why){
money.put(p.uuid(), new float[]{Mathf.pow(2.71f, 1f + wave / 2 + Mathf.pow(wave, 2) / 4000f) * 7f});
rewritePlayers();
};
});
});
Expand Down Expand Up @@ -179,6 +182,17 @@ public void setupUnits(){
});
}

public void rewritePlayers(){
Groups.player.each(p -> {
if(!units.containsKey(p.uuid())){
units.put(p.uuid(), UnitTypes.dagger.create(Team.sharded));
};
if(!money.containsKey(p.uuid())){
money.put(p.uuid(), new float[]{Mathf.pow(2.71f, 1f + wave / 2 + Mathf.pow(wave, 2) / 4000f) * 7f});
};
});
}

public void respawnPlayers(){
Groups.unit.each(u -> {
if(findPlayer(u) == null){
Expand All @@ -188,7 +202,7 @@ public void respawnPlayers(){
Groups.player.each(p -> {
Unit playerUnit = units.get(p.uuid());
if(playerUnit == null){
playerUnit = UnitTypes.dagger.spawn(worldCenterX, worldCenterY);
rewritePlayers();
};
if(p.unit().type == null){
int sX;
Expand Down Expand Up @@ -222,7 +236,7 @@ public void nextWave(){
state.wave = wave;
UnitTypes.crawler.health += 1 * wave;
UnitTypes.crawler.speed += 0.003 * wave;
float crawlers = Mathf.pow(2.71f, 1f + wave / 2 + Mathf.pow(wave, 2) / 200);
float crawlers = Mathf.pow(2.71f, 1f + wave / 2);
switch(wave){
case(21):
Call.sendMessage("[red]What makes you live for this long?");
Expand Down Expand Up @@ -257,8 +271,8 @@ public void nextWave(){
int toxopids = 0;
int spawnX = worldWidth - 32;
int spawnY = worldHeight - 32;
int spreadX = worldCenterX - 160;
int spreadY = worldCenterY - 160;
int spreadX = worldCenterX - 160 - wave * 3;
int spreadY = worldCenterY - 160 - wave * 3;
if(crawlers >= 100){
atraxes = Mathf.floor(Math.min(crawlers / 10f, 400));
crawlers -= atraxes;
Expand All @@ -273,7 +287,7 @@ public void nextWave(){
crawlers = 500;
};
if(crawlers >= 1000){
arkyids = Mathf.floor(crawlers / 2000f);
arkyids = Mathf.floor(crawlers / (2000f + (wave - 10) * 100));
crawlers = Math.min(crawlers, 1000);
};
for(int i = 0; i < crawlers; i++){
Expand Down

0 comments on commit b7dbaea

Please sign in to comment.