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:
parent
9a225d96ef
commit
0764fcb476
@ -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),
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user