Removed player damage/speed rules

these didn't work anyway, since units are player-controlled
This commit is contained in:
Anuken
2020-05-29 13:49:29 -04:00
parent 402fe88cf6
commit 5275599baf
8 changed files with 19 additions and 49 deletions

View File

@@ -30,7 +30,7 @@ public class Bullets implements ContentList{
standardGlaive, standardDenseBig, standardThoriumBig, standardIncendiaryBig,
//electric
lancerLaser, meltdownLaser, lightning, arc, damageLightning,
lancerLaser, meltdownLaser, arc, damageLightning,
//liquid
waterShot, cryoShot, slagShot, oilShot,
@@ -204,7 +204,7 @@ public class Bullets implements ContentList{
flakSurge = new FlakBulletType(4.5f, 13){{
splashDamage = 40f;
splashDamageRadius = 40f;
lightining = 2;
lightning = 2;
lightningLength = 12;
shootEffect = Fx.shootBig;
}};
@@ -250,7 +250,7 @@ public class Bullets implements ContentList{
lifetime = 150f;
hitEffect = Fx.blastExplosion;
despawnEffect = Fx.blastExplosion;
lightining = 2;
lightning = 2;
lightningLength = 14;
}};
@@ -581,31 +581,6 @@ public class Bullets implements ContentList{
drag = 0.03f;
}};
lightning = new BulletType(0.001f, 12f){
{
lifetime = 1f;
shootEffect = Fx.hitLancer;
smokeEffect = Fx.none;
despawnEffect = Fx.none;
hitEffect = Fx.hitLancer;
keepVelocity = false;
}
@Override
public float range(){
return 70f;
}
@Override
public void draw(Bulletc b){
}
@Override
public void init(Bulletc b){
Lightning.create(b.team(), Pal.lancerLaser, damage * (b.owner().isLocal() ? state.rules.playerDamageMultiplier : 1f), b.x(), b.y(), b.rotation(), 30);
}
};
arc = new LightningBulletType(){{
damage = 21;
lightningLength = 25;

View File

@@ -80,7 +80,7 @@ public abstract class BulletType extends Content{
public float homingPower = 0f;
public float homingRange = 50f;
public int lightining;
public int lightning;
public int lightningLength = 5;
public float weaveScale = 1f;
@@ -134,19 +134,19 @@ public abstract class BulletType extends Content{
if(splashDamageRadius > 0){
Damage.damage(b.team(), x, y, splashDamageRadius, splashDamage * b.damageMultiplier());
}
for(int i = 0; i < lightning; i++){
Lightning.create(b.team(), Pal.surge, damage, b.getX(), b.getY(), Mathf.random(360f), lightningLength);
}
}
public void despawned(Bulletc b){
despawnEffect.at(b.getX(), b.getY(), b.rotation());
hitSound.at(b);
if(fragBullet != null || splashDamageRadius > 0){
if(fragBullet != null || splashDamageRadius > 0 || lightning > 0){
hit(b);
}
for(int i = 0; i < lightining; i++){
Lightning.create(b.team(), Pal.surge, damage, b.getX(), b.getY(), Mathf.random(360f), lightningLength);
}
}
public void draw(Bulletc b){

View File

@@ -19,6 +19,11 @@ public class LightningBulletType extends BulletType{
keepVelocity = false;
}
@Override
public float range(){
return lightningLength * 2.33f;
}
@Override
public void draw(Bulletc b){
}

View File

@@ -79,7 +79,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
@Override
public void update(){
if(unit.dead()){
if(unit.dead() || !unit.isAdded()){
clearUnit();
}
@@ -146,7 +146,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
}
boolean dead(){
return unit.isNull();
return unit.isNull() || unit.dead() || !unit.isAdded();
}
String uuid(){

View File

@@ -25,8 +25,6 @@ public enum Gamemode{
rules.enemyCoreBuildRadius = 600f;
rules.buildCostMultiplier = 1f;
rules.buildSpeedMultiplier = 1f;
rules.playerDamageMultiplier = 0.33f;
rules.playerHealthMultiplier = 0.5f;
rules.unitBuildSpeedMultiplier = 2f;
rules.unitHealthMultiplier = 3f;
rules.attackMode = true;

View File

@@ -14,7 +14,7 @@ import mindustry.world.*;
* Does not store game state, just configuration.
*/
public class Rules{
/** Whether the player has infinite resources. */
/** Whether the player team has infinite resources. */
public boolean infiniteResources;
/** Whether the waves come automatically on a timer. If not, waves come when the play button is pressed. */
public boolean waveTimer = true;
@@ -30,15 +30,11 @@ public class Rules{
public float unitBuildSpeedMultiplier = 1f;
/** How much health units start with. */
public float unitHealthMultiplier = 1f;
/** How much health players start with. */
public float playerHealthMultiplier = 1f;
/** How much health blocks start with. */
public float blockHealthMultiplier = 1f;
/** How much damage player mechs deal. */
public float playerDamageMultiplier = 1f;
/** How much damage any other units deal. */
public float unitDamageMultiplier = 1f;
/** Multiplier for buildings for the player. */
/** Multiplier for buildings resource cost. */
public float buildCostMultiplier = 1f;
/** Multiplier for building speed. */
public float buildSpeedMultiplier = 1f;

View File

@@ -153,10 +153,6 @@ public class CustomRulesDialog extends BaseDialog{
main.button("$bannedblocks", banDialog::show).left().width(300f);
main.row();
title("$rules.title.player");
number("$rules.playerhealthmultiplier", f -> rules.playerHealthMultiplier = f, () -> rules.playerHealthMultiplier);
number("$rules.playerdamagemultiplier", f -> rules.playerDamageMultiplier = f, () -> rules.playerDamageMultiplier);
title("$rules.title.unit");
number("$rules.unithealthmultiplier", f -> rules.unitHealthMultiplier = f, () -> rules.unitHealthMultiplier);
number("$rules.unitdamagemultiplier", f -> rules.unitDamageMultiplier = f, () -> rules.unitDamageMultiplier);

View File

@@ -66,7 +66,7 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
sep(bt, "$bullet.homing");
}
if(type.lightining > 0){
if(type.lightning > 0){
sep(bt, "$bullet.shock");
}