mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-20 10:55:08 +01:00
Add the god statue's blood return display and stamina system (#520)
* Fix announcement display * Approaching StatuesOfTheSeven will restore all health of the current team * Added god statue's blood return display and stamina system * fix error fix error * fix file
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.game.avatar.Avatar;
|
||||
import emu.grasscutter.game.entity.GameEntity;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.game.props.LifeState;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.AvatarLifeStateChangeNotifyOuterClass.AvatarLifeStateChangeNotify;
|
||||
import emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType;
|
||||
|
||||
public class PacketAvatarLifeStateChangeNotify extends BasePacket {
|
||||
|
||||
@@ -19,4 +22,15 @@ public class PacketAvatarLifeStateChangeNotify extends BasePacket {
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
public PacketAvatarLifeStateChangeNotify(Avatar avatar,int attackerId,LifeState lifeState) {
|
||||
super(PacketOpcodes.AvatarLifeStateChangeNotify);
|
||||
|
||||
AvatarLifeStateChangeNotify proto = AvatarLifeStateChangeNotify.newBuilder()
|
||||
.setAvatarGuid(avatar.getGuid())
|
||||
.setLifeState(lifeState.getValue())
|
||||
.setMoveReliableSeq(attackerId)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.game.entity.GameEntity;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.ChangeHpReasonOuterClass.ChangeHpReason;
|
||||
import emu.grasscutter.net.proto.EntityFightPropChangeReasonNotifyOuterClass.EntityFightPropChangeReasonNotify;
|
||||
import emu.grasscutter.net.proto.PropChangeReasonOuterClass.PropChangeReason;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PacketEntityFightPropChangeReasonNotify extends BasePacket {
|
||||
public PacketEntityFightPropChangeReasonNotify(GameEntity entity, FightProperty prop, Float value, List<Integer> param, PropChangeReason reason, ChangeHpReason changeHpReason) {
|
||||
super(PacketOpcodes.EntityFightPropChangeReasonNotify);
|
||||
EntityFightPropChangeReasonNotify.Builder proto = EntityFightPropChangeReasonNotify.newBuilder()
|
||||
.setEntityId(entity.getId())
|
||||
.setPropType(prop.getId())
|
||||
.setPropDelta(value)
|
||||
.setReason(reason)
|
||||
.setChangeHpReason(changeHpReason);
|
||||
for(int p: param){
|
||||
proto.addParamList(p);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
public PacketEntityFightPropChangeReasonNotify(GameEntity entity, FightProperty prop, Float value, PropChangeReason reason, ChangeHpReason changeHpReason) {
|
||||
super(PacketOpcodes.EntityFightPropChangeReasonNotify);
|
||||
EntityFightPropChangeReasonNotify proto = EntityFightPropChangeReasonNotify.newBuilder()
|
||||
.setEntityId(entity.getId())
|
||||
.setPropType(prop.getId())
|
||||
.setPropDelta(value)
|
||||
.setReason(reason)
|
||||
.setChangeHpReason(changeHpReason)
|
||||
.build();
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user