message ServerEffect {
ServerEffectType Type = 1;
int32 Value = 2;
int32 Place = 3;
uint32 TargetID = 6;
uint32 SubType = 5;
}
type ServerEffects struct {
Appear data.ServerEffectType
UseSkill data.ServerEffectType
UseSkillTarget data.ServerEffectType
EndUseSkill data.ServerEffectType
HealthChange data.ServerEffectType
WillChange data.ServerEffectType
HealthChangeCritical data.ServerEffectType
AddBuff data.ServerEffectType
RemoveBuff data.ServerEffectType
Miss data.ServerEffectType
MoneyDrop data.ServerEffectType
AddArgument data.ServerEffectType
EnergyChange data.ServerEffectType
}
export class ServerEffect implements IServerEffect {
constructor(properties?: IServerEffect);
public Type: ServerEffectType;
public Value: number;
public Place: number;
public TargetID: number;
public SubType: number;
public static create(properties?: IServerEffect): ServerEffect;
public static encode(message: IServerEffect, writer?: $protobuf.Writer): $protobuf.Writer;
public static encodeDelimited(message: IServerEffect, writer?: $protobuf.Writer): $protobuf.Writer;
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ServerEffect;
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ServerEffect;
public static verify(message: { [k: string]: any }): (string|null);
public static fromObject(object: { [k: string]: any }): ServerEffect;
public static toObject(message: ServerEffect, options?: $protobuf.IConversionOptions): { [k: string]: any };
public toJSON(): { [k: string]: any };
}
type ServerEffect struct {
Type ServerEffectType `protobuf:"varint,1,opt,name=Type,enum=ServerEffectType" json:"Type,omitempty"`
Value int32 `protobuf:"varint,2,opt,name=Value" json:"Value,omitempty"`
Place int32 `protobuf:"varint,3,opt,name=Place" json:"Place,omitempty"`
TargetID uint32 `protobuf:"varint,6,opt,name=TargetID" json:"TargetID,omitempty"`
SubType uint32 `protobuf:"varint,5,opt,name=SubType" json:"SubType,omitempty"`
}
func (m *ServerEffect) Reset() { *m = ServerEffect{} }
func (m *ServerEffect) String() string { return proto.CompactTextString(m) }
func (*ServerEffect) ProtoMessage() {}
func (*ServerEffect) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} }
type FList []*data.ServerEffect
type ServerEffect data.ServerEffect
func (s FList) AddSingle(f *ServerEffect ) FList {
if f == nil {
return s
}
return append(s, (*data.ServerEffect)(f))
}
func (s FList) Add(ss FList) FList {
return append(s, ss...)
}
var x, y FList
x = x.Add(y)
type ArmorSkill struct{}
func (a *ArmorSkill) UseOnTarget(
bs *BaseSkill, target *BaseCharacter,
owner *BaseCharacter, targetPlace int32) FList {
damage := 1 + (bs.EffectPower / 100.) * (target.MaxHP - target.HP)
return target.heal(damage, damage, nil, bs).Add(
target.addBuff(confBuffIDs.ChangeArmor, target, bs.DurationTurns, int32(bs.CustomValue), false, bs))
}
return FList(nil).AddSingle(&ServerEffect {})
renderEffect(x: IServerEffect, serverData: ServerData, playerData: IPlayerObject, accountData: IAccountGeneral) {
let targetid = x.TargetID;
switch (x.Type) {
case config.Skills.ServerEffects.NewRoom:
this.do(() => {
_.game.NewRoom(serverData, playerData, accountData);
});
break;
case config.Skills.ServerEffects.StartEnemyTurn:
this.do(() => {
_.pa.ShowTurnAnimation("Enemy turn", true);
}, config.Player.TurnNotificationDelay);
break;
case config.Skills.ServerEffects.TurnEnd:
this.do(() => {
network.sendPlayerCommand(config.Commands.CMD_ANIMATION_ENDED)
});
break;
case config.Skills.ServerEffects.ChangeState:
let time = (new Date()).getTime();
this.do(() => {
this.updateTurnState(x.Value, serverData, playerData, accountData, time);
});
break;
case config.Skills.ServerEffects.Overkill:
this.do(() => {
let n = network.getObj(targetid);
let target = n ? (<Actor>n.gameObject) : null;
_.sm.addTextParticle(config.TextConstants.Overkill, target, 'smallfontp', 0x00ff5511, 0.8)
});
break;
....
}