public override void DoAction(IEventArgs args) { FreeData fd = GetPlayer(args); int realTime = args.GetInt(time); if (realTime < 0) { fd.EffectBufs.RemoveEffect(args.GetString(effect), args.GetFloat(level)); } else { fd.EffectBufs.AddEffect(args.GetString(effect), args.GetFloat(level), realTime); } }
public override void DoAction(IEventArgs args) { //if (FreeLog.IsEnable()) //{ logger.InfoFormat("{0} | {1}", DateTime.Now.ToString(), args.GetString(log)); //} }
public override UnitPosition Select(IEventArgs args) { IniCon(); UnitPosition up = new UnitPosition(); FreeRuleEventArgs fr = (FreeRuleEventArgs)args; if (!string.IsNullOrEmpty(player)) { object obj = fr.GetEntity(args.GetString(player)); if (obj != null) { if (obj is PlayerEntity) { PlayerEntity playerEntity = (PlayerEntity)obj; fr.TempUse("current", (FreeData)playerEntity.freeData.FreeData); UnityPositionUtil.SetPlayerToUnitPosition(playerEntity, up); if (fromEye) { up.SetY(up.GetY() + 1.7f); } fr.Resume("current"); } if (obj is FreeMoveEntity) { FreeMoveEntity playerEntity = (FreeMoveEntity)obj; fr.TempUse("current", (FreeEntityData)playerEntity.freeData.FreeData); UnityPositionUtil.SetEntityToUnitPosition(playerEntity.position, up); fr.Resume("current"); } } } else if (!string.IsNullOrEmpty(condition)) { if (con == null || con.Meet(args)) { foreach (PlayerEntity unit in args.GameContext.player.GetInitializedPlayerEntities()) { if (unit.hasFreeData) { fr.TempUse("current", (FreeData)unit.freeData.FreeData); UnityPositionUtil.SetPlayerToUnitPosition(unit, up); fr.Resume("current"); } } } } return(GetPosition(args, up, FreeUtil.ReplaceFloat(angle, args) + up.GetYaw())); }
public override void DoAction(IEventArgs args) { EffectBuf buf = new EffectBuf(); buf.key = args.GetString(key); buf.type = (EffectType)effectType; PlayerEffectBuf.RegisterEffectBuf(buf); }
public override TestValue GetCaseValue(IEventArgs args) { TestValue tv = new TestValue(); if (number) { tv.AddField(exp, args.getDouble(exp)); } else { tv.AddField(exp, args.GetString(exp)); } return(tv); }
protected override void BuildMessage(IEventArgs args) { builder.Key = args.GetInt(key); if (fields != null) { for (int i = 0; i < fields.Count; i++) { switch (fields[i].type) { case KeyField: builder.Ks.Add(args.GetInt(fields[i].value)); break; case IntField: builder.Ins.Add(args.GetInt(fields[i].value)); break; case BoolField: builder.Bs.Add(args.GetBool(fields[i].value)); break; case StringField: builder.Ss.Add(args.GetString(fields[i].value)); break; case FloatField: builder.Fs.Add(args.GetFloat(fields[i].value)); break; case DoubleField: builder.Ds.Add(args.getDouble(fields[i].value)); break; case LongField: builder.Ls.Add(args.GetLong(fields[i].value)); break; } } } }