Browse Source

stun grounds 1 tier per 1.5 seconds of stunned

lakebane
FatBoy-DOTC 1 week ago
parent
commit
f96d0caf3c
  1. 23
      src/engine/objects/PlayerCharacter.java

23
src/engine/objects/PlayerCharacter.java

@ -4914,15 +4914,22 @@ public class PlayerCharacter extends AbstractCharacter {
GroundPlayer(this); GroundPlayer(this);
//ChatManager.chatSystemInfo(this, "You Cannot Fly While Having A MovementBuff"); //ChatManager.chatSystemInfo(this, "You Cannot Fly While Having A MovementBuff");
} }
if(this.getDesiredAltitude() == this.getAltitude() && this.bonuses.getBool(ModType.Stunned, SourceType.None)){ if(!this.timestamps.containsKey("StunGrounded"))
this.setAltitude(this.getAltitude()); this.timestamps.put("StunGrounded",System.currentTimeMillis() - 1000L);
this.setDesiredAltitude(this.getAltitude() - 10); if(this.bonuses.getBool(ModType.Stunned, SourceType.None) && this.timestamps.get("StunGrounded") < System.currentTimeMillis()){
this.setTakeOffTime(System.currentTimeMillis()); boolean isFlyMoving = this.getDesiredAltitude() != this.altitude;
if(!isFlyMoving && this.bonuses.getBool(ModType.Stunned, SourceType.None)){
ChangeAltitudeMsg msg = new ChangeAltitudeMsg(this.getObjectType().ordinal(), this.getObjectUUID(), false, this.getAltitude(), this.getDesiredAltitude(), this.getAltitude()); this.setDesiredAltitude(this.altitude - 10);
// force a landing this.setTakeOffTime(System.currentTimeMillis());
DispatchMessage.dispatchMsgToInterestArea(this, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
ChangeAltitudeMsg msg = new ChangeAltitudeMsg(this.getObjectType().ordinal(), this.getObjectUUID(), false, this.getAltitude(), this.getDesiredAltitude(), this.getAltitude());
// force a landing
DispatchMessage.dispatchMsgToInterestArea(this, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
this.timestamps.put("StunGrounded",System.currentTimeMillis() + 1500L);
ChatManager.chatSystemInfo(this,"Applying 1 Tier Ground");
}
} }
} }
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save