public LivingSayAction(Living living, string msg, int type, int delay, int finishTime) : base(delay, finishTime) { m_living = living; m_msg = msg; m_type = type; }
protected void player_AfterKillingLiving(Living living, Living target, int damageAmount, int criticalAmount) { if (IsTrigger) { target.AddEffect(new ContinueReduceBloodEffect(2,-m_blood), 0); } }
public LivingDirectSetXYAction(Living living, int x, int y, int delay) : base(delay) { m_living = living; m_x = x; m_y = y; }
public LivingSealAction(Living Living, Player target, int type, int delay) : base(delay, 2000) { m_Living = Living; m_Target = target; m_Type = type; }
void player_AfterKillingLiving(Living living, Living target, int damageAmount, int criticalAmount) { if (IsTrigger) { target.AddEffect(new LockDirectionEffect(2), 0); } }
public sealed override void OnAttached(Living living) { if (living is Player) { OnAttachedToPlayer(living as Player); } }
public sealed override void OnRemoved(Living living) { if (living is Player) { OnRemovedFromPlayer(living as Player); } }
void player_AfterKilledByLiving(Living living, Living target, int damageAmount, int criticalAmount) { if (IsTrigger) { target.AddBlood(-m_count); } }
public override void OnRemoved(Living living) { living.BeginSelfTurn -= new LivingEventHandle(player_BeginFitting); //living.IsFrost = false; (living as Player).BaseDamage = (living as Player).BaseDamage * 100 / 5; living.Game.SendPlayerPicture(living, 4, false); }
public LivingPlayeMovieAction(Living living, string action, int delay, int movieTime) : base(delay, movieTime) { m_living = living; m_action = action; }
void player_AfterKillingLiving(Living living, Living target, int damageAmount, int criticalAmount) { if (IsTrigger) { target.AddEffect(new ReduceStrengthEffect(2), 0); } }
void player_BeginFitting(Living living) { m_count--; if (m_count <= 0) { Stop(); } }
public override bool Start(Living living) { if (living is Player) { return base.Start(living); } return false; }
void player_BeginFitting(Living player) { m_count--; if (m_count < 0) { Stop(); } }
private void player_BeginFitting(Living player) { m_count--; if (m_count <= 0) { this.Stop(); } }
void player_BeforeTakeDamage(Living living, Living source, ref int damageAmount, ref int criticalAmount) { if (IsTrigger) { damageAmount += m_count; living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("AddDamageEffect.Success")); // living.Game.SendAttackEffect(living, 1); reEn } }
public virtual bool Start(Living living) { m_living = living; if (m_living.EffectList.Add(this)) { return true; } return false; }
public LivingRangeAttackingAction(Living living, int fx, int tx, string action, int delay, List<Player>players) : base(delay, 1000) { m_living = living; m_players = players; m_fx = fx; m_tx = tx; m_action = action; }
void player_BeforeTakeDamage(Living living, Living source, ref int damageAmount, ref int criticalAmount) { if (IsTrigger) { living.AddBlood(damageAmount * m_count / 100); living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("AssimilateBloodEffect.Success")); //living.Game.SendAttackEffect(living, 1); } }
void player_AfterKilledByLiving(Living living, Living target, int damageAmount, int criticalAmount) { if (rand.Next(100) < m_probability) { living.ShootMovieDelay = 50; SpellMgr.ExecuteSpell(living.Game, living as Player, ItemMgr.FindItemTemplate(10021)); // living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("NoHoleEquipEffect.Success")); } }
public LivingBeatAction(Living living, Living target, int demageAmount, int criticalAmount, string action, int delay) : base(delay) { m_living = living; m_target = target; m_demageAmount = demageAmount; m_criticalAmount = criticalAmount; m_action = action; }
public LivingMoveToAction(Living living, List<Point> path, string action, int delay, LivingCallBack callback) : base(delay, 0) { m_living = living; m_path = path; m_action = action; m_isSent = false; m_index = 0; m_callback = callback; }
public override void OnAttached(Living living) { living.BeginSelfTurn += new LivingEventHandle(player_BeginFitting); //living.IsFrost = true; if (living is Player) { (living as Player).BaseDamage = (living as Player).BaseDamage * 5 / 100; } living.Game.SendPlayerPicture(living, 4, true); }
public LivingBeatAction(Living living, Living target, int demageAmount, int criticalAmount, string action, int delay,int livingCount, int attackEffect) : base(delay) { m_living = living; m_target = target; m_demageAmount = demageAmount; m_criticalAmount = criticalAmount; m_action = action; m_livingCount = livingCount; m_attackEffect = attackEffect; }
public void ChangeProperty(Living living) { IsTrigger = false; if (rand.Next(100) < m_probability) { IsTrigger = true; living.EffectTrigger = true; living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("ReflexDamageEquipEffect.Success", m_count)); living.Game.SendAttackEffect(living, 2); } }
void player_BeforeTakeDamage(Living living, Living source, ref int damageAmount, ref int criticalAmount) { IsTrigger = false; if (rand.Next(100) < m_probability) { IsTrigger = true; living.EffectTrigger = true; damageAmount = -damageAmount; //living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("AvoidDamageEffect.Success")); } }
public override void StartMoving() { base.StartMoving(); m_actions = new List <BombAction>(); int oldLifeTime = m_game.LifeTime; while (m_isMoving && m_isLiving) { m_lifeTime += 0.04F; // Console.WriteLine(string.Format("af:{0},wf:{1},gf:{2} vx: {3} vy:{4} x:{5},y:{6}", Arf, Wf, Gf, vX, vY, X, Y)); Point pos = CompleteNextMovePoint(0.04F); MoveTo(pos.X, pos.Y); if (m_isLiving) { if (Math.Round(m_lifeTime * 100) % 40 == 0 && pos.Y > 0) { m_game.AddTempPoint(pos.X, pos.Y); } if (m_controled && vY > 0)//瞄准 { Living player = m_map.FindNearestEnemy(m_x, m_y, 150, m_owner); Point v; if (player != null) { if (player is SimpleBoss) { Rectangle dis = player.GetDirectDemageRect(); v = new Point(dis.X - m_x, dis.Y - m_y); } else { v = new Point(player.X - m_x, player.Y - m_y); } v = v.Normalize(1000); setSpeedXY(v.X, v.Y); //使炮弹不受重力和风力和空气阻力的影响 UpdateForceFactor(0, 0, 0); m_controled = false; m_actions.Add(new BombAction(m_lifeTime, ActionType.CHANGE_SPEED, v.X, v.Y, 0, 0)); } } } if (m_bombed) { m_bombed = false; BombImp(); } } }
public LivingJumpAction(Living living, int toX, int toY, int speed, string action, int delay, int type, LivingCallBack callback) : base(delay, 2000) { m_living = living; m_toX = toX; m_toY = toY; m_speed = speed; m_action = action; m_isSent = false; m_type = type; m_callback = callback; }
void player_BeginFitting(Living living) { m_count--; if (living is Player) { (living as Player).Energy -= 50; } if (m_count < 0) { Stop(); } }
protected int MakeDamage(Living target) { int result; if (target is SimpleNpc && (target as SimpleNpc).NpcInfo.Type == 3) { result = 1; } else { double baseDamage = this.m_owner.BaseDamage; double baseGuard = target.BaseGuard; double defence = target.Defence; double attack = this.m_owner.Attack; if (this.m_owner.IgnoreArmor) { baseGuard = 0.0; defence = 0.0; } float damagePlus = this.m_owner.CurrentDamagePlus; float shootMinus = this.m_owner.CurrentShootMinus; double DR = 0.95 * (baseGuard - (double)(3 * this.m_owner.Grade)) / (500.0 + baseGuard - (double)(3 * this.m_owner.Grade)); double DR2; if (defence - this.m_owner.Lucky < 0.0) { DR2 = 0.0; } else { DR2 = 0.95 * (defence - this.m_owner.Lucky) / (600.0 + defence - this.m_owner.Lucky); } double damage = baseDamage * (1.0 + attack * 0.001) * (1.0 - (DR + DR2 - DR * DR2)) * (double)damagePlus * (double)shootMinus; Point p = new Point(this.X, this.Y); double distance = target.Distance(p); if (distance <= (double)this.m_radius) { damage *= 1.0 - distance / (double)this.m_radius / 4.0; if (damage < 0.0) { result = 1; } else { result = (int)damage; } } else { result = 0; } } return(result); }
void player_BeforeTakeDamage(Living living, Living source, ref int damageAmount, ref int criticalAmount) { IsTrigger = false; if (rand.Next(100) < m_probability) { IsTrigger = true; living.EffectTrigger = true; criticalAmount = (int)(0.5 + (living.Lucky * 0.0005) * damageAmount); living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("MakeCriticalEffect.Success")); //living.Game.SendAttackEffect(living, 1); } }
public void ChangeProperty(Living living) { IsTrigger = false; if (rand.Next(100) < m_probability) { IsTrigger = true; living.EffectTrigger = true; living.Blood += m_count; living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("AddBloodEffect.Success", m_count)); //living.Game.SendAttackEffect(living, 2);reEn } }
protected int MakeDamage(Living target) { double baseDamage = m_owner.BaseDamage; double baseGuard = target.BaseGuard; double defence = target.Defence; double attack = m_owner.Attack; if (m_owner.IgnoreArmor) { baseGuard = 0; defence = 0; } float damagePlus = m_owner.CurrentDamagePlus; float shootMinus = m_owner.CurrentShootMinus; //伤害={ 基础伤害*(1+攻击*0.1%)*[1-(基础护甲/200+防御*0.03%)] }*(1+道具攻击加成)*炸弹威力*连击系数 // double damage = (baseDamage * ( 1 + attack * 0.001) * (1 - (baseGuard / 200 + defence * 0.003))) * (1 + damagePlus) * shootMinus ; double DR1 = 0.95 * (target.BaseGuard - 3 * m_owner.Grade) / (500 + target.BaseGuard - 3 * m_owner.Grade);//护甲提供伤害减免 double DR2 = 0; if ((target.Defence - m_owner.Lucky) < 0) { DR2 = 0; } else { DR2 = 0.95 * (target.Defence - m_owner.Lucky) / (600 + target.Defence - m_owner.Lucky); //防御提供的伤害减免 } //DR2 = DR2 < 0 ? 0 : DR2; double damage = (baseDamage * (1 + attack * 0.001) * (1 - (DR1 + DR2 - DR1 * DR2))) * damagePlus * shootMinus; Point p = new Point(X, Y); double distance = target.Distance(p); if (distance < m_radius) { damage = damage * (1 - distance / m_radius / 4); if (damage < 0) { return(1); } } else { return(0); } return((int)damage); }
public virtual bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, int type, int delay) { bool result = false; bool result2; if (!this.IsFrost && this.m_blood > 0) { if (this.m_game is PVEGame) { if (!((PVEGame)this.m_game).CanCampAttack(source, this)) { result2 = false; return(result2); } } if (type == 0) { this.OnBeforeTakedDamage(source, ref damageAmount, ref criticalAmount, delay); this.StartAttacked(); } this.m_blood -= damageAmount + criticalAmount; if (source.WillIceForonze && source.IsLiving) { this.BeginNextTurn = (LivingEventHandle)Delegate.Combine(this.BeginNextTurn, new LivingEventHandle(this.SetIceFronze)); } if (this.m_syncAtTime) { if (this is SimpleBoss && (((SimpleBoss)this).NpcInfo.ID == 1207 || ((SimpleBoss)this).NpcInfo.ID == 1307)) { this.m_game.SendGameUpdateHealth(this, 6, damageAmount + criticalAmount); } else { this.m_game.SendGameUpdateHealth(this, 1, damageAmount + criticalAmount); } } this.OnAfterTakedDamage(source, damageAmount, criticalAmount, delay); if (this.m_blood <= 0) { this.Die(); } source.OnAfterKillingLiving(this, damageAmount, criticalAmount, delay); result = true; } this.EffectList.StopEffect(typeof(IceFronzeEffect)); this.EffectList.StopEffect(typeof(HideEffect)); this.EffectList.StopEffect(typeof(NoHoleEffect)); result2 = result; return(result2); }
public SimpleBomb(int id, BombType type, Living owner, BaseGame game, BallInfo info, Tile shape, bool controled) : base(id, (float)info.Mass, (float)info.Weight, (float)info.Wind, (float)info.DragIndex) { this.m_owner = owner; this.m_game = game; this.m_info = info; this.m_shape = shape; this.m_type = type; this.m_power = info.Power; this.m_radius = info.Radii; this.m_controled = controled; this.m_bombed = false; this.m_lifeTime = 0f; this.digMap = true; }
public virtual bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg) { bool result = false; if (IsFrost == false && m_blood > 0) { if (source != this || source.Team == this.Team) { OnBeforeTakedDamage(source, ref damageAmount, ref criticalAmount); } m_blood -= (damageAmount + criticalAmount); if (EffectTrigger && this is Player) { Game.SendMessage((this as Player).PlayerDetail, LanguageMgr.GetTranslation("PlayerEquipEffect.Success2"), LanguageMgr.GetTranslation("PlayerEquipEffect.Success3", (this as Player).PlayerDetail.PlayerCharacter.NickName), 3); } if (m_syncAtTime) { if (this is SimpleBoss && (((SimpleBoss)this).NpcInfo.ID == 22 || ((SimpleBoss)this).NpcInfo.ID == 29)) { m_game.SendGameUpdateHealth(this, 6, damageAmount + criticalAmount); } else { m_game.SendGameUpdateHealth(this, 1, damageAmount + criticalAmount); } } OnAfterTakedDamage(source, damageAmount, criticalAmount); if (m_blood <= 0) { Die(); } //log.Error(string.Format("调用函数" + msg + string.Format("----玩家名称:{0},ID{1}", this.Name, Id) + string.Format("----当前血量{0}", Blood))); if (this is Player) { //Console.WriteLine("伤血{0}", damageAmount + criticalAmount); // Console.WriteLine("玩家{0}, 血量{1}", this.Name, Blood); } result = true; } EffectList.StopEffect(typeof(IceFronzeEffect)); EffectList.StopEffect(typeof(HideEffect)); EffectList.StopEffect(typeof(NoHoleEffect)); return(result); }
public override bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, int type, int delay) { if ((source == this || source.Team == base.Team) && damageAmount + criticalAmount >= this.m_blood) { damageAmount = this.m_blood - 1; criticalAmount = 0; } bool result = base.TakeDamage(source, ref damageAmount, ref criticalAmount, type, delay); if (base.IsLiving && result) { base.AddDander(damageAmount * 500 / base.MaxBlood); } return(result); }
public override bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg) { if ((source == this || source.Team == base.Team) && damageAmount + criticalAmount >= this.m_blood) { damageAmount = this.m_blood - 1; criticalAmount = 0; } bool result = base.TakeDamage(source, ref damageAmount, ref criticalAmount, msg); if (base.IsLiving) { base.AddDander((damageAmount * 2 / 5 + 5) / 2); } return(result); }
public bool Beat(Living target, string action, int delay, bool isdemage) { bool result; if (target == null || !target.IsLiving) { result = false; } else { int demageAmount = this.MakeDamage(target); result = this.BeatImpl(target, action, delay, demageAmount, isdemage); } return(result); }
public override void StartMoving() { base.StartMoving(); this.m_actions = new List <BombAction>(); this.m_petActions = new List <BombAction>(); int arg_27_0 = this.m_game.LifeTime; while (this.m_isMoving && this.m_isLiving) { this.m_lifeTime += 0.04f; Point point = base.CompleteNextMovePoint(0.04f); base.MoveTo(point.X, point.Y); if (this.m_isLiving) { if (Math.Round((double)(this.m_lifeTime * 100f)) % 40.0 == 0.0 && point.Y > 0) { this.m_game.AddTempPoint(point.X, point.Y); } if (this.m_controled && base.vY > 0f) { Living living = this.m_map.FindNearestEnemy(this.m_x, this.m_y, 150.0, this.m_owner); if (living != null) { Point point2; if (living is SimpleBoss) { Rectangle directDemageRect = living.GetDirectDemageRect(); point2 = new Point(directDemageRect.X - this.m_x, directDemageRect.Y - this.m_y); } else { point2 = new Point(living.X - this.m_x, living.Y - this.m_y); } point2 = point2.Normalize(1000); base.setSpeedXY(point2.X, point2.Y); base.UpdateForceFactor(0f, 0f, 0f); this.m_controled = false; this.m_actions.Add(new BombAction(this.m_lifeTime, ActionType.CHANGE_SPEED, point2.X, point2.Y, 0, 0)); } } } if (this.m_bombed) { this.m_bombed = false; this.BombImp(); } } }
public bool IsFriendly(Living living) { if (living is Player) { return(false); } if (living.Team == Team) { return(true); } else { return(false); } }
protected int MakeCriticalDamage(Living target, int baseDamage) { double lucky = this.m_owner.Lucky; bool canHit = lucky * 70.0 / (2000.0 + lucky) > (double)this.m_game.Random.Next(100); int result; if (canHit) { result = (int)((0.5 + lucky * 0.0003) * (double)baseDamage); } else { result = 0; } return(result); }
protected int MakeCriticalDamage(Living target, int baseDamage) { double lucky = m_owner.Lucky; //Random rd = new Random(); bool canHit = lucky * 75 / (800 + lucky) > ThreadSafeRandom.NextStatic(100); if (canHit) { return((int)((0.5 + lucky * 0.0003) * baseDamage)); } else { return(0); } }
public override void StartMoving() { base.StartMoving(); this.m_actions = new List <BombAction>(); int oldLifeTime = this.m_game.LifeTime; while (this.m_isMoving && this.m_isLiving && this.m_lifeTime < 80f) { this.m_lifeTime += 0.04f; Point pos = base.CompleteNextMovePoint(0.04f); base.MoveTo(pos.X, pos.Y); if (this.m_isLiving) { if (Math.Round((double)(this.m_lifeTime * 100f)) % 40.0 == 0.0 && pos.Y > 0) { this.m_game.AddTempPoint(pos.X, pos.Y); } if (this.m_controled && base.vY > 0f) { Living player = this.m_map.FindNearestEnemy(this.m_x, this.m_y, 150.0, this.m_owner); if (player != null) { Point v; if (player is SimpleBoss) { Rectangle dis = player.GetDirectDemageRect(); v = new Point(dis.X - this.m_x + 20, dis.Y + dis.Height - this.m_y); } else { v = new Point(player.X - this.m_x, player.Y - this.m_y); } v = v.Normalize(1000); base.setSpeedXY(v.X, v.Y); base.UpdateForceFactor(0f, 0f, 0f); this.m_controled = false; this.m_actions.Add(new BombAction(this.m_lifeTime, ActionType.CHANGE_SPEED, v.X, v.Y, 0, 0)); } } } if (this.m_bombed) { this.m_bombed = false; this.BombImp(); } } }
protected int MakeCriticalDamage(Living target, int baseDamage) { double lucky = this.m_owner.Lucky; Random random = new Random(); bool flag = lucky * 75.0 / (800.0 + lucky) > (double)random.Next(100); if (this.m_owner.critActive) { flag = this.m_owner.critActive; this.m_owner.critActive = false; } if (flag) { return((int)((0.5 + lucky * 0.0003) * (double)baseDamage)); } return(0); }
public override bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg) { bool result = false; result = base.TakeDamage(source, ref damageAmount, ref criticalAmount, msg); if (source is Player) { Player p = source as Player; int damage = damageAmount + criticalAmount; if (this.m_mostHateful.ContainsKey(p)) { this.m_mostHateful[p] += damage; return(result); } this.m_mostHateful.Add(p, damage); } return(result); }
public virtual void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount) { if (target.Team != this.Team) { this.CurrentIsHitTarget = true; this.TotalHurt += damageAmount + criticalAmount; if (!target.IsLiving) { this.TotalKill++; } this.m_game.CurrentTurnTotalDamage = damageAmount + criticalAmount; this.m_game.TotalHurt += damageAmount + criticalAmount; } if (this.AfterKillingLiving != null) { this.AfterKillingLiving(this, target, damageAmount, criticalAmount); } }
public virtual void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount) { if (target.Team != Team) { CurrentIsHitTarget = true; TotalHurt += (damageAmount + criticalAmount); if (target.IsLiving == false) { TotalKill++; } m_game.CurrentTurnTotalDamage = damageAmount + criticalAmount; m_game.TotalHurt += (damageAmount + criticalAmount); } if (AfterKillingLiving != null) { AfterKillingLiving(this, target, damageAmount, criticalAmount); } }
public override bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg) { bool result = base.TakeDamage(source, ref damageAmount, ref criticalAmount, msg); if (source is Player) { Player key = source as Player; int num = damageAmount + criticalAmount; if (this.m_mostHateful.ContainsKey(key)) { this.m_mostHateful[key] = this.m_mostHateful[key] + num; } else { this.m_mostHateful.Add(key, num); } } return(result); }
public void GetShootForceAndAngle(ref int x, ref int y, int bombId, int minTime, int maxTime, int bombCount, float time, ref int force, ref int angle) { if (minTime >= maxTime) { return; } BallInfo ballInfo = BallMgr.FindBall(bombId); if (this.m_game != null && ballInfo != null) { Map map = this.m_game.Map; Point shootPoint = this.GetShootPoint(); float num = (float)(x - shootPoint.X); float num2 = (float)(y - shootPoint.Y); float af = map.airResistance * (float)ballInfo.DragIndex; float f = map.gravity * (float)ballInfo.Weight * (float)ballInfo.Mass; float f2 = map.wind * (float)ballInfo.Wind; float m = (float)ballInfo.Mass; for (float num3 = time; num3 <= 4f; num3 += 0.6f) { double num4 = Living.ComputeVx((double)num, m, af, f2, num3); double num5 = Living.ComputeVy((double)num2, m, af, f, num3); if (num5 < 0.0 && num4 * (double)this.m_direction > 0.0) { double num6 = Math.Sqrt(num4 * num4 + num5 * num5); if (num6 < 2000.0) { force = (int)num6; angle = (int)(Math.Atan(num5 / num4) / 3.1415926535897931 * 180.0); if (num4 < 0.0) { angle += 180; break; } break; } } } x = shootPoint.X; y = shootPoint.Y; } }
public override bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg) { bool result = false; //玩家炸自己炸不死 if ((source == this || source.Team == this.Team) && damageAmount + criticalAmount >= m_blood) { damageAmount = m_blood - 1; criticalAmount = 0; } result = base.TakeDamage(source, ref damageAmount, ref criticalAmount, msg); if (IsLiving) { AddDander((damageAmount * 2 / 5 + 5) / 2); } //Console.WriteLine("最后伤血{0}", damageAmount); return(result); }
protected int MakeDamage(Living target) { double baseDamage = this.BaseDamage; double baseGuard = target.BaseGuard; double defence = target.Defence; double attack = this.Attack; if (this.IgnoreArmor) { baseGuard = 0.0; defence = 0.0; } float damagePlus = this.CurrentDamagePlus; float shootMinus = this.CurrentShootMinus; double DR = 0.95 * (baseGuard - (double)(3 * this.Grade)) / (500.0 + baseGuard - (double)(3 * this.Grade)); double DR2; if (defence - this.Lucky < 0.0) { DR2 = 0.0; } else { DR2 = 0.95 * (defence - this.Lucky) / (600.0 + defence - this.Lucky); } double damage = baseDamage * (1.0 + attack * 0.001) * (1.0 - (DR + DR2 - DR * DR2)) * (double)damagePlus * (double)shootMinus; Point p = new Point(this.X, this.Y); int result; if (damage < 0.0) { result = 1; } else { result = (int)damage; } return(result); }
public virtual bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg) { if (!this.NoTakeDamage && this is SimpleNpc) { return(false); } bool result = false; if (!this.IsFrost && this.m_blood > 0) { if (source != this || source.Team == this.Team) { this.OnBeforeTakedDamage(source, ref damageAmount, ref criticalAmount); } this.m_blood -= damageAmount + criticalAmount; if (this.EffectTrigger && this is Player) { this.Game.SendMessage((this as Player).PlayerDetail, LanguageMgr.GetTranslation("PlayerEquipEffect.Success2", new object[0]), LanguageMgr.GetTranslation("PlayerEquipEffect.Success3", new object[] { (this as Player).PlayerDetail.PlayerCharacter.NickName }), 3); } if (this.m_syncAtTime) { this.m_game.SendGameUpdateHealth(this, 6, damageAmount + criticalAmount); } this.OnAfterTakedDamage(source, damageAmount, criticalAmount); if (this.m_blood <= 0) { this.Die(); } Player arg_F3_0 = this as Player; result = true; } this.EffectList.StopEffect(typeof(IceFronzeEffect)); this.EffectList.StopEffect(typeof(HideEffect)); this.EffectList.StopEffect(typeof(NoHoleEffect)); return(result); }
public void GetShootForceAndAngle(ref int x, ref int y, int bombId, int minTime, int maxTime, int bombCount, float time, ref int force, ref int angle) { if (minTime < maxTime) { BallInfo ballInfo = BallMgr.FindBall(bombId); if (this.m_game != null && ballInfo != null) { Map map = this.m_game.Map; Point sp = this.GetShootPoint(); float dx = (float)(x - sp.X); float dy = (float)(y - sp.Y); float arf = map.airResistance * (float)ballInfo.DragIndex; float gf = map.gravity * (float)ballInfo.Weight * (float)ballInfo.Mass; float wf = map.wind * (float)ballInfo.Wind; float mass = (float)ballInfo.Mass; for (float t = time; t <= 4f; t += 0.6f) { double vx = Living.ComputeVx((double)dx, mass, arf, wf, t); double vy = Living.ComputeVy((double)dy, mass, arf, gf, t); if (vy < 0.0 && vx * (double)this.m_direction > 0.0) { double tf = Math.Sqrt(vx * vx + vy * vy); if (tf < 2000.0) { force = (int)tf; angle = (int)(Math.Atan(vy / vx) / 3.1415926535897931 * 180.0); if (vx < 0.0) { angle += 180; } break; } } } x = sp.X; y = sp.Y; } } }
public override void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount) { base.OnAfterKillingLiving(target, damageAmount, criticalAmount); if (target is Player) { this.m_player.OnKillingLiving(this.m_game, 1, target.Id, target.IsLiving, damageAmount + criticalAmount); return; } int id = 0; if (target is SimpleBoss) { SimpleBoss simpleBoss = target as SimpleBoss; id = simpleBoss.NpcInfo.ID; } if (target is SimpleNpc) { SimpleNpc simpleNpc = target as SimpleNpc; id = simpleNpc.NpcInfo.ID; } this.m_player.OnKillingLiving(this.m_game, 2, id, target.IsLiving, damageAmount + criticalAmount); }
public override bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, int type, int delay) { bool result = base.TakeDamage(source, ref damageAmount, ref criticalAmount, type, delay); if (source is Player) { Player p = source as Player; int damage = damageAmount + criticalAmount; if (this.m_mostHateful.ContainsKey(p)) { this.m_mostHateful[p] = this.m_mostHateful[p] + damage; } else { this.m_mostHateful.Add(p, damage); } } if (result) { this.OnShooted(delay); } return(result); }
public override void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount) { base.OnAfterKillingLiving(target, damageAmount, criticalAmount); if (target is Player)//目标为玩家还是NPC { m_player.OnKillingLiving(m_game, 1, target.Id, target.IsLiving, damageAmount + criticalAmount); } else { int targetId = 0; if (target is SimpleBoss) { SimpleBoss tempBoss = target as SimpleBoss; targetId = tempBoss.NpcInfo.ID; } if (target is SimpleNpc) { SimpleNpc tempNpc = target as SimpleNpc; targetId = tempNpc.NpcInfo.ID; } m_player.OnKillingLiving(m_game, 2, targetId, target.IsLiving, damageAmount + criticalAmount); } }
public override void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount, int delay) { base.OnAfterKillingLiving(target, damageAmount, criticalAmount, delay); if (target is Player) { this.m_player.OnKillingLiving(this.m_game, 1, target.Id, target.IsLiving, damageAmount + criticalAmount, this.PlayerDetail.IsArea); this.CalculatePlayerOffer(target as Player); } else { int targetId = 0; if (target is SimpleBoss) { SimpleBoss tempBoss = target as SimpleBoss; targetId = tempBoss.NpcInfo.ID; } if (target is SimpleNpc) { SimpleNpc tempNpc = target as SimpleNpc; targetId = tempNpc.NpcInfo.ID; } this.m_player.OnKillingLiving(this.m_game, 2, targetId, target.IsLiving, damageAmount + criticalAmount, false); } }
public bool Beat(Living target, string action, int demageAmount, int criticalAmount, int delay, int livingCount, int attackEffect) { if (target == null || !target.IsLiving) { return(false); } demageAmount = this.MakeDamage(target); int num = (int)target.Distance(this.X, this.Y); if (num <= this.MaxBeatDis) { if (this.X - target.X > 0) { this.Direction = -1; } else { this.Direction = 1; } this.m_game.AddAction(new LivingBeatAction(this, target, demageAmount, criticalAmount, action, delay, livingCount, attackEffect)); return(true); } return(false); }
private bool BeatImpl(Living target, string action, int delay, int demageAmount, bool isdemage) { int dis = (int)target.Distance(this.X, this.Y); bool result; if (dis <= this.MaxBeatDis) { if (this.X - target.X > 0) { this.Direction = -1; } else { this.Direction = 1; } this.m_game.AddAction(new LivingBeatAction(this, target, demageAmount, 0, action, delay, isdemage)); result = true; } else { result = false; } return(result); }