1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-21 13:28:12 +03:00

More random unit effects (#5272)

* More random fall smoke effects

* Do the same with status effects.
This commit is contained in:
MEEP of Faith 2021-05-19 05:25:28 -07:00 committed by GitHub
parent 9a225d96ef
commit 0764fcb476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -348,13 +348,13 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
//standard fall smoke
if(Mathf.chanceDelta(0.1)){
Tmp.v1.setToRandomDirection().scl(hitSize);
Tmp.v1.rnd(Mathf.range(hitSize));
type.fallEffect.at(x + Tmp.v1.x, y + Tmp.v1.y);
}
//thruster fall trail
if(Mathf.chanceDelta(0.2)){
float offset = type.engineOffset/2f + type.engineOffset/2f*elevation;
float offset = type.engineOffset/2f + type.engineOffset/2f * elevation;
float range = Mathf.range(type.engineSize);
type.fallThrusterEffect.at(
x + Angles.trnsx(rotation + 180, offset) + Mathf.range(range),

View File

@ -123,7 +123,7 @@ public class StatusEffect extends UnlockableContent{
}
if(effect != Fx.none && Mathf.chanceDelta(effectChance)){
Tmp.v1.rnd(unit.type.hitSize /2f);
Tmp.v1.rnd(Mathf.range(unit.type.hitSize/2f));
effect.at(unit.x + Tmp.v1.x, unit.y + Tmp.v1.y);
}
}