//private bool withShield = true; // Use this for initialization void Start() { anim = GetComponent<Animator>(); attacker = GetComponent<Attacker>(); health = GetComponent<Health>(); originalSpeed = attacker.currentSpeed; anim.SetBool("withShield", true); }
// Use this for initialization void Start() { audioSource = GetComponent<AudioSource>(); audioSource.volume = PlayerPrefsManager.GetMasterVolume(); anim = GetComponent<Animator>(); attacker = GetComponent<Attacker>(); }
public ViewModel(Attacker attacker, DamageDistribution damageDistribution) { _damageDistribution = damageDistribution; _assignments = new BlockerDamageAssignments(attacker); _attacker = attacker; _totalDamageToAssign = attacker.Card.CalculateCombatDamageAmount(); _damageLeftToAssign = _totalDamageToAssign; }
// Use this for initialization void Start () { anim = GetComponent<Animator>(); attacker = GetComponent<Attacker>(); audioSource = GetComponent<AudioSource>(); if(!audioSource) { audioSource = gameObject.AddComponent<AudioSource>(); } }
public void SetTarget(Attackable target, Attacker owner) { Owner = owner; Target = target; rigid.AddForce(Direction.normalized * StartForce, ForceMode2D.Impulse); float rot_z = Mathf.Atan2(Direction.normalized.y, Direction.normalized.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(0f, 0f, rot_z - 90); }
// Use this for initialization void Start() { if (GetComponent<Animator>()) { anim = GetComponent<Animator>(); } else { anim = GetComponentInChildren<Animator>(); } attacker = GetComponent<Attacker>(); }
// Update is called once per frame void Update () { this.slider.value = Time.timeSinceLevelLoad / levelTimeSec; if (Time.timeSinceLevelLoad >= levelTimeSec && !endOfLevel) { attacker = FindObjectOfType<Attacker>(); if (!attacker) { EndOfLevel(); } } }
public ViewModel(Attacker attacker, DamageAssignmentOrder assignmentOrder) { _attacker = attacker; _blockerAssignments = attacker.Blockers.Select( blocker => Bindable.Create<BlockerAssignment>(blocker)).ToList(); _assignmentOrder = assignmentOrder; }
// Use this for initialization void Start() { if (GetComponent<Animator>()) { anim = GetComponent<Animator>(); } else { anim = GetComponentInChildren<Animator>(); } attacker = GetComponent<Attacker>(); //originalSpeed = 0.3f; //attacker.SetSpeed(originalSpeed); }
public override void OnAttacked(Attacker attacker, float force) { if (!IsFlailing) FallOver(); MyRgd.AddForceAtPosition(attacker.MyTr.forward * force, attacker.MyTr.position, ForceMode.Impulse); if (attacker.Faction != Factions.Player) { Instantiate<GameObject>(PunchParticlesPrefab).transform.position = attacker.MyTr.position; } }
protected override IEnumerator Die(Attacker attacker) { if (MinionInfo.Infos.Count > 0) { Minion[] minions = MinionInfo.Spawn(transform.position); KI_Owner owner = new GameObject().AddComponent<KI_Owner>(); owner.CurrentTargetPosition = BodyCenter; for (int i = 0; i < minions.Length; i++) { owner.AddMinion(minions[i], true); } owner.SetCurrentAttacker(attacker); } for (int i = 0; i < Souls; i++) { ReleaseSouls(attacker.Owner); yield return new WaitForSeconds(0.1f); } yield return null; gameObject.Despawn(); }
public AttackerDecorator(Attacker enemy) { this.decoratedAttacker = enemy; }
// Use this for initialization void Awake() { mover = this.GetComponent<Mover>(); FSM = this.GetComponent<FiniteStateMachine>(); attacker = this.GetComponent<Attacker>(); }
private void Spawn(Attacker myAttacker) { Attacker newAttacker = Instantiate(myAttacker, transform.position, transform.rotation) as Attacker; newAttacker.transform.parent = transform; }
public abstract void OnAttacked(Attacker attacker, float force);
// Use this for initialization void Start() { animator = GetComponent <Animator>(); attacker = GetComponent <Attacker>(); }
public override float Damage(float amount, Attacker attacker) { float damageDone = base.Damage(amount, attacker); damaged += damageDone; if (BricksToLose.Count > 0) { int count = (int)(damaged / DamagePerBrick); for (int i = 0; i < count; i++) { if (BricksToLose.Count == 0) break; if (BricksToLose[BricksToLose.Keys[0]].Count == 0) { BricksToLose.RemoveAt(0); i--; continue; } brick = BricksToLose[BricksToLose.Keys[0]].RandomEntry(BrickWeight); if (brick == null) { i--; continue; } brick.Losen(); BricksToLose[BricksToLose.Keys[0]].Remove(brick); } damaged -= count * DamagePerBrick; } return damageDone; }
// Use this for initialization void Start() { foxAnimator = GetComponent <Animator>(); parentAttacker = GetComponentInParent <Attacker>(); }
private void Awake() { attacker = GetComponent <Attacker>(); animator = GetComponentInChildren <Animator>(); }
private void SpawnAttacker() { Attacker newAttacker = Instantiate(RandomSpawn(), transform.position, transform.rotation) as Attacker; newAttacker.transform.parent = transform; }
// Use this for initialization void Start() { // Obtain the animator and attacker scripts anim = GetComponent <Animator>(); attacker = GetComponent <Attacker>(); }
void Start() { thisTransform = transform; fxPlayer = GetComponent<FXPlayer>(); //GameObject spawnedBar = Instantiate(energyBarPrefab) as GameObject; //spawnedBar.transform.parent = transform; //spawnedBar.transform.localPosition = new Vector3(0,1f,0); //energyBar = spawnedBar.GetComponent<DisplayBar>(); //energyBar.DisplayValue = energy; attacker = GetComponent<Attacker>(); attacker.OnTargetLeaveRange += targetLeftRange; attacker.OnTargetInRange += targetInRange; attacker.OnTargetDeath += targetDied; //attacker.OnBeginAttacking += startedAttacking; attacker.OnActualAttack += attack; navigator = GetComponent<Navigator>(); if(navigator != null) { navigator.OnWalking += walking; navigator.OnStartWalk += startWalking; navigator.OnStopWalk += stopWalking; } life = GetComponent<Life>(); life.OnBeingAttacked += wasAttacked; //StartCoroutine(energyRegen()); SubscribeToInputDelegates(); }
// Use this for initialization void Start() { anim = gameObject.GetComponent <Animator> (); attacker = gameObject.GetComponent <Attacker> (); }
private void Awake() { attacker = GetComponent<Attacker>(); }
public virtual void SetCurrentAttacker(Attacker attacker) { Target = attacker; }
void SpawnAttacker() { Attacker attackerPrefab = attackers[Random.Range(0, attackers.Length)]; Attacker newAttacker = Instantiate(attackerPrefab, transform.position, transform.rotation, transform); }
private void Spawn(Attacker attackerPrefab) { Attacker newAttacker = Instantiate(attackerPrefab, transform.position, transform.rotation) as Attacker; // Add the newly created attacker as a child to the object that created us newAttacker.transform.parent = transform; }
private void SpawnEnemy() { Attacker newAttacker = Instantiate(GetEnemy(), transform.position, transform.rotation) as Attacker; newAttacker.transform.parent = transform; }
public virtual void Heal(float amount, Attacker healer) { if (amount == 0) return; if (amount < 0) { Damage(-amount, healer); return; } Health = Mathf.Min(Health + amount, MaxHealth); }
private void Spawn(Attacker attackerPrefab) { Attacker newAttacker = Instantiate(attackerPrefab, gameObject.transform.position, Quaternion.identity) as Attacker; newAttacker.transform.parent = transform; }
private void Spawn(Attacker myAttacker) { Attacker newAttacker = Instantiate(myAttacker, transform.position, Quaternion.identity) as Attacker; newAttacker.transform.parent = transform; // spawns the attacker as a child of its spawner! }
// Update is called once per frame void Update() { if (phase == Phase.Connecting) { bool allConnected = true; for (int i = 0; i < nodes.Count; i++) { if (UniMoveController.GetNumConnected() > 0) { if (nodes[i].controller == null) { UniMoveController controller = nodes[i].gameObject.AddComponent <UniMoveController>(); if (controller.Init(i)) { controller.InitOrientation(); controller.ResetOrientation(); nodes[i].Init(controller, this.debugButtons[i]); } else { Destroy(controller); allConnected = false; } } } else { nodes[i].InitDebug(i <= 1?1:2, this.debugButtons[i]); } } if (allConnected) { for (int i = 0; i < nodes.Count; i++) { if (nodes[i].type == 1) { Target target = nodes[i].gameObject.AddComponent <Target>(); target.HitEvent += OnTargetHit; targets.Add(target); } else { Attacker attacker = nodes[i].gameObject.AddComponent <Attacker>(); attacker.HitEvent += OnAttackerHit; attacker.TimeoutEvent += OnAttackerTimeout; attacker.TimeoutWarningEvent += OnAttackerTimeoutWarning; attackers.Add(attacker); } } phase = Phase.Waiting; } } else if (phase == Phase.Waiting) { // start game if (Input.GetKeyDown(KeyCode.Space)) { bool practice = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift); StartGame(practice); } } else if (phase == Phase.Playing) { // stop game if (Input.GetKeyDown(KeyCode.Space)) { StopGame(); } // heal if (Input.GetKeyDown(KeyCode.H)) { Heal(); } } else if (phase == Phase.Ended) { } if (Input.GetKeyDown(KeyCode.D)) { //ControllerDebug.Active = !ControllerDebug.Active; debugPanel.SetActive(!debugPanel.activeSelf); } if (Input.GetKeyDown(KeyCode.S)) { setupPanel.SetActive(!setupPanel.activeSelf); } }
void Start() { this._attacker = this.GetComponent <Attacker>(); }
void OnAttackerTimeoutWarning(Attacker attacker) { voAudioSource.PlayOneShot(voCountdownWarning[voVariationIndex % voHit.Length]); }
protected override void DoSkill(IBattleUnit attackTarget, double timeDelta) { _poisonEffect.DamagePerSecond = Convert.ToInt64(Attacker.GetDamage() * DamagePerSecondKoef + BonusDamagePerSecond); attackTarget.EffectService.Add(_poisonEffect); }
public void Spawn(Attacker attackerPrefab) { Attacker newAttacker = Instantiate(attackerPrefab, transform.position, transform.rotation) as Attacker; newAttacker.transform.parent = transform; }
internal AttackCompletedEventArgs(Attacker attacker) { Attacker=attacker; }
public static Attacker GetRootAsAttacker(ByteBuffer _bb, Attacker obj) { return(obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public virtual OrderStatus Execute(Random Random) { Attacker.Fire(AttackTile, UseSecondaryWeapon); return(OrderStatus.FINISHED); }
private void Spawn(Attacker myAttacker) { Attacker newAttacker = Instantiate(myAttacker, transform.position, transform.rotation); newAttacker.transform.parent = transform; //This transform is now the parent of the newAttacker. }
internal AttackStartedEventArgs(Attacker attacker) { Attacker = attacker; }
public void SpawnAttacker() { Attacker newAttacker = Instantiate(attackerSpawn, transform.position, transform.rotation) as Attacker; newAttacker.transform.parent = transform; }
public override void OnAttacked(Attacker attacker, float force) { Vector3 awayFromHitter = (rigd.position - attacker.MyTr.position).normalized; rigd.velocity += force * ForceMultiplier * awayFromHitter; }
public static Attacker GetRootAsAttacker(ByteBuffer _bb, Attacker obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return(obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public BlockerJoinedCombatEvent(Blocker blocker, Attacker attacker) { Blocker = blocker; Attacker = attacker; }
// Start is called before the first frame update void Start() { attacker = GetComponentInParent <Attacker>(); }
//called by attacker to apply attackInfo when a unit is attacked and hit public AttackInstance ApplyHitEffect(AttackInstance attInstance){ //HitResult hitResult= ApplyDamage(attInstance); if(attInstance.missed) audioTB.PlayMissed(); else{ audioTB.PlayHit(); animationTB.PlayHit(); } if(!ContainedInAttackerList(attInstance.srcUnit)){ Attacker attacker=new Attacker(attInstance.srcUnit); attackerList.Add(attacker); } triggered=true; //perform counter attack if possible //if the rule allows it if(attInstance.type==_AttackType.Range_Normal || attInstance.type==_AttackType.Melee_Normal){ if(GameControlTB.IsCounterAttackEnabled()){ //if the target is still not destroyed and have a counter attack move remain if(!attInstance.destroyed && counterAttackRemain>0){ //if the attacker is within attack distance float dist=AStar.Distance(occupiedTile, attInstance.srcUnit.occupiedTile); if(dist>=GetAttackRangeMin() && dist<=GetAttackRangeMax()){ attInstance.counterAttacking=true; StartCoroutine(CounterAttackRoutine(attInstance.srcUnit)); } } } } return attInstance; }
private static bool IsPlayer(Attacker arg) { return(arg.CharacterID != 0); }
// Use this for initialization void Start() { attacker = GetComponent<Attacker>(); }
public AttackerJoinedCombatEvent(Attacker attacker, bool wasDeclared) { Attacker = attacker; WasDeclared = wasDeclared; }
public virtual float Damage(float amount, Attacker attacker) { if (amount == 0) return 0f; if (amount < 0) { Heal(-amount, attacker); return 0f; } float before = Health; Health = Mathf.Max(Health - amount, 0f); if (Health == 0f) { StartCoroutine(Die(attacker)); } return before - Health; }
// Use this for initialization void Start() { anim = GetComponent<Animator> (); attacker = GetComponent<Attacker> (); DetectDifficulty (); }
protected virtual IEnumerator Die(Attacker attacker) { yield return null; if (ReleaseSoulWhenDead) ReleaseSouls(attacker.Owner); Despawn(); }
private void Start() { ANIMSTATE = ANIM_STATE.IDLE; animator = GetComponent <Animator>(); attacker = GetComponent <Attacker>(); }
private static bool IsGateCampShip(Attacker attacker) { return(Types.IsGateCampShip(attacker.ShipTypeID, attacker.WeaponTypeID)); }
public FreezingAttacker(Attacker decoratedAttacker) : base(decoratedAttacker) { }
void Start() { thisTransform = transform; startPosition = thisTransform.position; attacker = GetComponent<Attacker>(); attacker.OnTargetLeaveRange += targetLeftRange; attacker.OnTargetInRange += targetInRange; attacker.OnTargetDeath += targetDied; attacker.OnBeginAttacking += startedAttacking; attacker.OnActualAttack += attack; navigator = GetComponent<Navigator>(); navigator.OnWalking += walking; navigator.OnStartWalk += startWalking; navigator.OnStopWalk += stopWalking; life = GetComponent<Life>(); life.OnBeingAttacked += wasAttacked; StartCoroutine("prowl"); //StartCoroutine(repeatHurt()); lineOfSight = (Instantiate(lineOfSightPrefab) as GameObject).GetComponent<LineRenderer>(); lineOfSight.gameObject.SetActiveRecursively(false); }
// Start is called before the first frame update void Start() { attacker = transform.parent.GetComponent <Attacker>(); }
// Use this for initialization void Start() { foxAnimator = GetComponent<Animator>(); attacker = GetComponent<Attacker>(); }
public static Skillbase CreateSKill(Skill skill, Attacker owner) { Skillbase sk = new Skillbase(skill, owner); switch (skill) { case Skill.Strong: sk.Name = skill.ToString(); sk.Cost = 30; sk.selfBuff.Add(new buff() { attr = AttrType.MaxHp, value = 100f }); sk.selfBuff.Add(new buff() { attr = AttrType.MaxHpRatio, value = 0.2f }); sk.Time = 30f; sk.CoolDown = 45f; sk.SkillType = SkillType.Self; sk.icon = "32px/Elements_Life"; sk.iconColor = Color.green; break; case Skill.Wise: sk.Name = skill.ToString(); sk.Cost = 30; sk.selfBuff.Add(new buff() { attr = AttrType.MaxMp, value = 100f }); sk.selfBuff.Add(new buff() { attr = AttrType.MaxMpRatio, value = 0.2f }); sk.Time = 30f; sk.CoolDown = 45f; sk.SkillType = SkillType.Self; sk.icon = "32px/Weapons_Staff"; sk.iconColor = Color.blue; break; case Skill.Power: sk.Name = skill.ToString(); sk.Cost = 25; sk.selfBuff.Add(new buff() { attr = AttrType.AtkRatio, value = 0.25f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Self; sk.icon = "32px/Weapons_Sword"; sk.iconColor = Color.white; break; case Skill.Protect: sk.Name = skill.ToString(); sk.Cost = 25; sk.selfBuff.Add(new buff() { attr = AttrType.Def, value = 10f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Self; sk.icon = "32px/Equipment_Shield"; sk.iconColor = Color.white; break; case Skill.Agile: sk.Name = skill.ToString(); sk.Cost = 25; sk.selfBuff.Add(new buff() { attr = AttrType.SpdRatio, value = 0.1f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Self; sk.icon = "32px/Equipment_Boots"; sk.iconColor = Color.blue; break; case Skill.Bless: sk.Name = skill.ToString(); sk.Cost = 25; sk.selfBuff.Add(new buff() { attr = AttrType.LukRatio, value = 0.2f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Self; sk.icon = "32px/Rewards_Star"; sk.iconColor = Color.yellow; break; case Skill.Touch: sk.Name = skill.ToString(); sk.Cost = 25; sk.selfBuff.Add(new buff() { attr = AttrType.MdRatio, value = 0.2f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Self; sk.icon = "32px/Elements_Ground"; sk.iconColor = Color.yellow; break; case Skill.Smash: sk.Name = skill.ToString(); sk.Cost = 15; sk.Damage = 350; sk.targetBuff.Add(new buff() { attr = AttrType.Def, value = -50f }); sk.selfBuff.Add(new buff() { attr = AttrType.Atk, value = 50f }); sk.Time = 10f; sk.CoolDown = 20f; sk.SkillType = SkillType.Both; sk.icon = "32px/Tools_Hammer"; sk.iconColor = Color.red; break; case Skill.IceImpact: sk.Name = skill.ToString(); sk.Cost = 15; sk.Damage = 100; sk.targetBuff.Add(new buff() { attr = AttrType.SpdRatio, value = -0.5f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Target; sk.icon = "32px/Elements_Ice"; sk.iconColor = Color.blue; break; case Skill.Heal: sk.Name = skill.ToString(); sk.Cost = 50; sk.Healing = 250; sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Self; sk.icon = "32px/Elements_Water"; sk.iconColor = Color.blue; break; case Skill.HeroPower: sk.Name = skill.ToString(); sk.Cost = 0; sk.Healing = 1500; sk.selfBuff.Add(new buff() { attr = AttrType.MaxHp, value = 500 }); sk.selfBuff.Add(new buff() { attr = AttrType.MaxMp, value = 200 }); sk.selfBuff.Add(new buff() { attr = AttrType.Atk, value = 100 }); sk.selfBuff.Add(new buff() { attr = AttrType.Def, value = 100 }); sk.selfBuff.Add(new buff() { attr = AttrType.Luk, value = 30 }); sk.selfBuff.Add(new buff() { attr = AttrType.Md, value = 100 }); sk.selfBuff.Add(new buff() { attr = AttrType.Spd, value = 50 }); sk.selfBuff.Add(new buff() { attr = AttrType.MaxHpRatio, value = .2f }); sk.selfBuff.Add(new buff() { attr = AttrType.MaxMpRatio, value = .2f }); sk.selfBuff.Add(new buff() { attr = AttrType.AtkRatio, value = .5f }); sk.selfBuff.Add(new buff() { attr = AttrType.DefRatio, value = .5f }); sk.selfBuff.Add(new buff() { attr = AttrType.SpdRatio, value = .2f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Self; sk.icon = "32px/Modifiers_LevelUp"; sk.iconColor = Color.yellow; break; case Skill.PoisonAttack: sk.Name = skill.ToString(); sk.Cost = 0; sk.Damage = 150; sk.targetBuff.Add(new buff() { attr = AttrType.Def, value = -1f, tickInterval = 3f }); sk.targetBuff.Add(new buff() { attr = AttrType.CurHp, value = -50, tickInterval = 1f }); sk.targetBuff.Add(new buff() { attr = AttrType.Atk, value = -2, tickInterval = 3f }); sk.targetBuff.Add(new buff() { attr = AttrType.Spd, value = -2, tickInterval = 3f }); sk.Time = 15f; sk.CoolDown = 30f; sk.SkillType = SkillType.Target; sk.icon = "32px/Elements_Death"; sk.iconColor = Color.green; break; default: break; } return(sk); }