public void Update() { if(m_Target) { if(!m_Target.IsAlive) { if(!m_IsEnabled) { setGraphicsEnable(true); } if(Timer) { float time_left = Mathf.Clamp(m_Target.RemainingRespawnCooldown, 0.0f, m_Target.RespawnTime); if(time_left > 0.0f) { Timer.text = time_left.ToString("F2"); } else { Timer.text = "READY"; } } if(LeftSlider) { LeftSlider.maxValue = m_Target.RespawnTime; LeftSlider.value = m_Target.RemainingRespawnCooldown; } if(RightSlider) { RightSlider.maxValue = m_Target.RespawnTime; RightSlider.value = m_Target.RemainingRespawnCooldown; } } else { setGraphicsEnable(false); } } else { m_Target = findTarget(); } }
public virtual void HandleHit(Bullet bullet, Living sprite) { sprite.ApplyDamage(Damage); SpriteContainer.Remove(bullet); if (!sprite.IsAlive()) SpriteContainer.Remove(sprite); afterSuccessfulHit(bullet, sprite); }
public void player_BeforeTakeDamage(Living living, Living source, ref int damageAmount, ref int criticalAmount, int delay) { if (damageAmount > 1) { if ((damageAmount -= this.m_count) <= 0) { damageAmount = 1; } } }
public LivingMoveToAction(Living living, List <Point> path, int stepx, string action, int delay, LivingCallBack callback) : base(delay, 0) { this.m_living = living; this.m_path = path; this.m_stepx = stepx; this.m_action = action; this.m_isSent = false; this.m_index = 0; this.m_callback = callback; }
internal void SendGameUpdateSealState(Living player, int type) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD, player.Id); pkg.Parameter1 = player.Id; pkg.WriteByte((byte)eTankCmdType.SEAL); pkg.WriteByte((byte)type); pkg.WriteBoolean(player.GetSealState()); SendToAll(pkg); }
internal void SendGamePickBox(Living player, int index, int arkType, string goods) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD, player.Id); pkg.WriteByte((byte)eTankCmdType.PICK); pkg.WriteByte((byte)index); pkg.WriteByte((byte)arkType); pkg.WriteString(goods); SendToAll(pkg); }
internal void SendLivingUpdateDirection(Living living) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.Parameter1 = living.Id; pkg.WriteByte((byte)eTankCmdType.DIRECTION); pkg.WriteInt(living.Direction); SendToAll(pkg); }
public override IEnumerator ProcessCollision(Collider collider) { Living livingEntity = collider.gameObject.GetComponentInChildren <Living>(); if (livingEntity) { livingEntity.TakeDamage(m_Spikes.Damage); yield break; } }
public ActionResult Edit([Bind(Include = "Id,ValueOfGuests,ValueOfKids,Settling,Eviction,NumberOfApartments")] Living living) { if (ModelState.IsValid) { db.Entry(living).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(living)); }
private void Start() { _living = FindObjectOfType <Living>(); _audio = FindObjectsOfType <AudioSource>(); _movement = FindObjectOfType <Movement>(); _continueButtonText = _continueButton.transform.GetChild(0).gameObject.GetComponent <Text>(); _gamePlay = FindObjectOfType <GamePlay>(); GetControl(); Stop(); }
public ActionResult ShowAdditionalServices(int id) { Living living = db.Livings.Include(a => a.Apartments).Include(c => c.Client).Include(s => s.AditionServices).ToList().Find(x => x.Id == id); if (living == null) { return(HttpNotFound()); } return(RedirectToAction("Index", "AditionServices", new { id = living.Id })); }
internal void SendLivingUpdateAngryState(Living living) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.Parameter1 = living.Id; pkg.WriteByte((byte)eTankCmdType.LIVING_STATE); pkg.WriteInt(living.State); SendToAll(pkg); }
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 override void ModifyWorld() { Chunk oldChunk = MagicalLifeAPI.World.Data.World.GetChunkByTile(this.Dimension, this.OldLocation.X, this.OldLocation.Y); Chunk newChunk = MagicalLifeAPI.World.Data.World.GetChunkByTile(this.Dimension, this.NewLocation.X, this.NewLocation.Y); Living l = oldChunk.Creatures[this.EntityID]; l.GetExactComponent <ComponentSelectable>().MapLocation = this.NewLocation; oldChunk.Creatures.Remove(this.EntityID); newChunk.Creatures.Add(this.EntityID, l); }
public override void MakePreparations(Living l) { Tile tile = World.Data.World.GetTile(l.Dimension, this.Target.X, this.Target.Y); this.Minable = tile.Resources; if (tile.Resources == null) { MasterLog.DebugWriteLine("Minable is null"); } }
private void player_AfterKillingLiving(Living living, Living target, int damageAmount, int criticalAmount, int delay) { if (this.IsTrigger) { if (target is Player) { target.AddEffect(new ContinueReduceBaseDamageEffect(2, this.m_count), 0); } } }
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 bool Start(Living living) { MakeCriticalEffect makeCriticalEffect = living.EffectList.GetOfType(eEffectType.MakeCriticalEffect) as MakeCriticalEffect; if (makeCriticalEffect != null) { makeCriticalEffect.m_probability = ((this.m_probability > makeCriticalEffect.m_probability) ? this.m_probability : makeCriticalEffect.m_probability); return(true); } return(base.Start(living)); }
public override bool Start(Living living) { NoHoleEffect noHoleEffect = living.EffectList.GetOfType(eEffectType.NoHoleEffect) as NoHoleEffect; if (noHoleEffect != null) { noHoleEffect.m_count = this.m_count; return(true); } return(base.Start(living)); }
public override bool Start(Living living) { ContinueReduceDamageEquipEffect continueReduceDamageEquipEffect = living.EffectList.GetOfType(eEffectType.ContinueReduceBaseDamageEquipEffect) as ContinueReduceDamageEquipEffect; if (continueReduceDamageEquipEffect != null) { continueReduceDamageEquipEffect.m_probability = ((this.m_probability > continueReduceDamageEquipEffect.m_probability) ? this.m_probability : continueReduceDamageEquipEffect.m_probability); return(true); } return(base.Start(living)); }
private void player_BeforeTakeDamage(Living living, Living source, ref int damageAmount, ref int criticalAmount) { this.IsTrigger = false; if (this.rand.Next(100) < this.m_probability) { this.IsTrigger = true; living.EffectTrigger = true; damageAmount *= 1 - this.m_count / 100; living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("AvoidDamageEffect.Success", new object[0])); } }
private void player_BeforeTakeDamage(Living living, Living source, ref int damageAmount, ref int criticalAmount) { this.IsTrigger = false; if (this.rand.Next(100) < this.m_probability) { this.IsTrigger = true; living.EffectTrigger = true; criticalAmount = (int)(0.5 + living.Lucky * 0.0005 * (double)damageAmount); living.Game.SendEquipEffect(living, LanguageMgr.GetTranslation("MakeCriticalEffect.Success", new object[0])); } }
public override bool Equals(System.Object obj) { if (obj == null) { return(false); } Living agent = obj as Living; return(agent != null && this.getIdentity().getID() == agent.getIdentity().getID()); }
public override bool Start(Living living) { AvoidDamageEffect avoidDamageEffect = living.EffectList.GetOfType(eEffectType.AvoidDamageEffect) as AvoidDamageEffect; if (avoidDamageEffect != null) { avoidDamageEffect.m_probability = ((this.m_probability > avoidDamageEffect.m_probability) ? this.m_probability : avoidDamageEffect.m_probability); return(true); } return(base.Start(living)); }
public override bool Start(Living living) { HideEffect hideEffect = living.EffectList.GetOfType(eEffectType.HideEffect) as HideEffect; if (hideEffect != null) { hideEffect.m_count = this.m_count; return(true); } return(base.Start(living)); }
public override bool Start(Living living) { InvinciblyEffect invinciblyEffect = living.EffectList.GetOfType(eEffectType.InvinciblyEffect) as InvinciblyEffect; if (invinciblyEffect != null) { invinciblyEffect.m_count = this.m_count; return(true); } return(base.Start(living)); }
public override bool Start(Living living) { ReduceStrengthEffect reduceStrengthEffect = living.EffectList.GetOfType(eEffectType.ReduceStrengthEffect) as ReduceStrengthEffect; if (reduceStrengthEffect != null) { reduceStrengthEffect.m_count = this.m_count; return(true); } return(base.Start(living)); }
public override bool Start(Living living) { AddDefenceEffect addDefenceEffect = living.EffectList.GetOfType(eEffectType.AddDefenceEffect) as AddDefenceEffect; if (addDefenceEffect != null) { addDefenceEffect.m_probability = ((this.m_probability > addDefenceEffect.m_probability) ? this.m_probability : addDefenceEffect.m_probability); return(true); } return(base.Start(living)); }
public override bool Start(Living living) { LockDirectionEquipEffect lockDirectionEquipEffect = living.EffectList.GetOfType(eEffectType.LockDirectionEquipEffect) as LockDirectionEquipEffect; if (lockDirectionEquipEffect != null) { lockDirectionEquipEffect.m_probability = ((this.m_probability > lockDirectionEquipEffect.m_probability) ? this.m_probability : lockDirectionEquipEffect.m_probability); return(true); } return(base.Start(living)); }
public override bool Start(Living living) { ContinueReduceBloodEffect continueReduceBloodEffect = living.EffectList.GetOfType(eEffectType.ContinueDamageEffect) as ContinueReduceBloodEffect; if (continueReduceBloodEffect != null) { continueReduceBloodEffect.m_count = this.m_count; return(true); } return(base.Start(living)); }
/// <summary> /// Returns the total cost of moving between two tiles. /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="mover">The creature that would move between the two tiles.</param> /// <returns>If the return value is -1, then the end tile cannot be moved into.</returns> public static int CalculateMovementCost(Tile start, Tile end, Living mover) { int total = 0; foreach (IAddMovementCost item in MovementCostRules) { total += item.GetMovementCost(start, end, mover); } return(total); }
void OnSelectGameObject(object sender, SelectGameObjectArgs e) { var living = e.GameObject.GetComponent<Living> (); if (living == null) { panel.SetActive (false); if (current_living != null) { current_living.Life.ValueChange -= new EventHandler<ObservableEventArgs<int>> (OnLivingValueChange); } } else { panel.SetActive (true); current_living = living; current_living.Life.ValueChange += new EventHandler<ObservableEventArgs<int>> (OnLivingValueChange); updateText (living.Life.ToString ()); } }
void Awake() { menuItem = GetComponent<Pushable>(); living = GetComponent<Living>(); enabled = false; menuItem.enabled = false; if(living) { living.enabled = false; } SetState(eState.OUT); }
public bool IsGuardedBy(Living _living) { if (guard == _living) return true; return false; }
public void Awake() { m_PlayerHealth = GetComponent<Living>(); }
public virtual void Deliver(Living l, Vector3 v) { }
protected override void afterSuccessfulHit(Bullet bullet, Living sprite) { }
public override void Deliver(Living l, Vector3 v) { Enemy e = l.GetComponent<Enemy>(); e.transform.SetParent(e.myProperties.myGameInstance.transform, false); e.transform.localPosition = v; }
public void Awake() { m_Target = findTarget(); m_Graphics = new List<Graphic>(GetComponentsInChildren<Graphic>()); setGraphicsEnable(false); }
public void AddCreature(Living l) { _creatures.Add(l); if (l.GetType().IsSubclassOf(typeof(Minion))) { _minions.Add((Minion)l); } }
protected abstract void afterSuccessfulHit(Bullet bullet, Living sprite);