public virtual void release(KGCharacterController releaser, AttackEffect ae) { m_SkeletonAnimation.AnimationName = ae.name; m_SkeletonAnimation.timeScale = ae.timeScale; m_Transform.localScale = new Vector3(releaser.character.xDirection * m_Transform.localScale.x, 1, 1); m_curAttack = new Attack(releaser, ae, releaser.character.xDirection); }
public static void ReleaseEffect(AttackEffect effect) { if (instance != null) { instance.ReleaseEffect_Instance(effect); } }
public override IEnumerator Execute(Unit attackerUnit, Unit targetUnit, Vector3Int targetPos, LevelTile targetTile) { bool isAttackingAlly = targetUnit != null && attackerUnit.Player.faction == targetUnit.Player.faction; AttackEffect executedEffect = isAttackingAlly ? allyAttackEffect : enemyAttackEffect; yield return(executedEffect.Execute(attackerUnit, targetUnit, targetPos, targetTile)); }
void DamageDoneOnHero(BattleHero hero, int damage) { AttackEffect attackEffect = m_AttackEffecPool.GetItem(); attackEffect.transform.position = hero.transform.position; attackEffect.RegulateSize(hero.GetComponent <RectTransform>()); attackEffect.gameObject.SetActive(true); StringBuilder builder = new StringBuilder(AttributeChange.HEALTH_DECREASE_TEXT); builder.Replace("{DECREASE}", damage.ToString()); AttributeChange attributeChange = AttribueChangeEffectPool.GetItem(); attributeChange.PrepareForActivation(hero.transform, false, builder.ToString()); attributeChange.gameObject.SetActive(true); if (!hero.IsEnemy) { CurrentFightSettings.selectedAllyHeroIndex = FindHeroIndex(m_PlayerHeroes, hero); } EventMessenger.NotifyEvent(SaveEvents.SAVE_GAME_STATE); bool isDead = hero.TakeDamage(damage); }
void Awake() { col = GetComponent <BoxCollider2D>(); rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); atkEffect = atkArea.GetComponent <AttackEffect>(); }
public SelectReactionActivity(TurnContext currentTurn, Player player, AttackEffect attackEffect) : base(currentTurn.Game.Log, player, "Select a reaction to use, click Done when finished.", SelectionSpecifications.SelectUpToXCards(1)) { _currentTurn = currentTurn; _attackEffect = attackEffect; Specification.CardTypeRestriction = typeof (IReactionCard); }
private bool ApplyEffect(GameObject target, GameObject attacker, AttackEffect effect, float duration, float potency, float chance) { if (effect == AttackEffect.NONE) { return(false); } //Apply effect bool success = target.GetComponent <PlayerStats>().AddEffect(effect, potency, chance); if (!success) { return(false); } //If it succeeded, show a popup and remove the effect in a few seconds string message = null; switch (effect) { case AttackEffect.PARALYZE: message = "Paralyzed!"; break; case AttackEffect.POISON: message = "Poisoned!"; break; case AttackEffect.STUN: message = "Stunned!"; break; case AttackEffect.TAUNT: message = "Taunted!"; break; } ShowPopup(message, 2, Color.red, 15, target.transform.position, false, -.001f, .002f); StartCoroutine(RemoveEffect(target, effect, duration)); //If this was a taunt, update the taunt target if (effect == AttackEffect.TAUNT) { target.GetComponent <PlayerStats>().SetTauntTarget(attacker); } return(true); }
public DamageRandomEnemyAction(DamageInfo _info, AttackEffect _effect) { info = _info; SetValues(AbstractDungeon.GetMonsters().GetRandomMonster(true), info); GameActionType = ActionType.Damage; GameAttackEffect = _effect; }
public SelectReactionActivity(TurnContext currentTurn, Player player, AttackEffect attackEffect) : base(currentTurn.Game.Log, player, "Select a reaction to use, click Done when finished.", SelectionSpecifications.SelectUpToXCards(1), null) { _currentTurn = currentTurn; _attackEffect = attackEffect; Specification.CardTypeRestriction = typeof(IReactionCard); }
//Applies effect, returns if successful //Unlike buffs, effects cannot stack, so this only adds if the effect isn't already present //When paralyzed, no effects will be added public bool AddEffect(AttackEffect effect, float potency, float chance) { //If the chance roll fails, return if (Random.Range(0f, 1f) > chance) { return(false); } //If currently paralyzed, return if (ActiveEffects.ContainsKey(AttackEffect.PARALYZE) && ActiveEffects[AttackEffect.PARALYZE] > 0) { return(false); } //If this effect is already active, return (no effect stacking) if (ActiveEffects.ContainsKey(effect) && ActiveEffects[effect] > 0) { return(false); } //Apply this effect ActiveEffects[effect] = potency; //If player is paralyzed or stunned, set flag if (effect == AttackEffect.PARALYZE || effect == AttackEffect.STUN) { UnableToMove = true; } //Success! return(true); }
public override void DoAttack(AttackEffect ae) { if (character.curState == animToState[ae.name]) { return; } base.DoAttack(ae); }
public BattleItem(string itemName, int itemIDNumber, int damage, AttackEffect effect) { name = itemName; itemID = itemIDNumber; attackDamage = damage; attackEffect = effect; }
//private bool isFirstGame; public DamageAllEnemiesAction(AbstractCreature _source, int[] _amount, DamageType _damageType, AttackEffect _attackEffect, bool _isFast) { SetValues(null, _source, _amount[0]); Damage = _amount; GameActionType = ActionType.Damage; GameDamageType = _damageType; GameAttackEffect = _attackEffect; }
public AttackEffect(AttackEffect other) { type = other.type; effectType = other.effectType; CalculatedEffectValue = other.CalculatedEffectValue; CalculatedDurationValue = other.CalculatedDurationValue; currentDuration = CalculatedDurationValue; }
public DamagePerCardAction(AbstractCreature _target, DamageInfo _info, string _cardName, AttackEffect _attackEffect) { damageInfo = _info; cardName = _cardName; GameAttackEffect = _attackEffect; SetValues(_target, _info); GameActionType = ActionType.Damage; }
public void OnBeeingAttacked() { AttackEffect attackEffect = gameObject.AddComponent <AttackEffect>(); attackEffect.mainImage = mainImage; attackEffect.duration = attackEffectDuration; attackEffect.effectColor = attackEffectColor; }
public DamageAction(AbstractCreature _target, DamageInfo _info, AttackEffect _effect) { goldAmount = 0; isSkipWait = false; damageInfo = _info; SetValues(_target, _info); GameActionType = ActionType.Damage; GameAttackEffect = _effect; }
public DamageAllButOneEnemyAction(AbstractCreature _source, AbstractCreature _target, int[] _amount, DamageType _damageType, AttackEffect _effect, bool _isFast) { isFirstFrame = true; SetValues(_target, _source, _amount[0]); Damage = _amount; GameActionType = ActionType.Damage; GameDamageType = _damageType; GameAttackEffect = _effect; }
public virtual void DoAttack(AttackEffect ae) { m_SkeletonAnim.AnimationName = ae.name; GameObject go = attackEffectPool.Instantiate(); go.transform.parent = transform; go.transform.position = transform.position; AttackEffectController aeCtrl = go.GetComponent<AttackEffectUtility>().m_AttackEffectController; aeCtrl.release(this, ae); ChangeState(); }
private void RenderEffectIcon(AttackEffect effect) { if (effect.icon != null) { effectImage.sprite = effect.icon; effectImage.gameObject.SetActive(true); effectTooltip.tooltipText = string.Format("{0} - {1}", effect.label, effect.description); } }
public ApplyPowerAction(AbstractCreature _target, AbstractCreature _source, AbstractPower _powerToApply, int _stackAmount, bool _isFast, AttackEffect _attackEffect) { SetValues(_target, _source, _stackAmount); powerToApply = _powerToApply; if (AbstractDungeon.Player.HasRelic("SnakeSkull") && Source != null && Source.IsPlayer && Target != Source && powerToApply.ID.Equals("Poison")) { //AbstractDungeon.Player.GetRelic("SnakeSull").flash(); powerToApply.Amount++; Amount++; } if (powerToApply.ID.Equals("Corruption")) //腐化 { for (int i = 0; i < AbstractDungeon.Player.Hand.Group.Count; i++) { AbstractCard tCard = AbstractDungeon.Player.Hand.Group[i]; if (tCard.Type == CardType.Skill) { tCard.ModifyCostForCombat(-9); } } for (int i = 0; i < AbstractDungeon.Player.DrawPile.Group.Count; i++) { AbstractCard tCard = AbstractDungeon.Player.DrawPile.Group[i]; if (tCard.Type == CardType.Skill) { tCard.ModifyCostForCombat(-9); } } for (int i = 0; i < AbstractDungeon.Player.DiscardPile.Group.Count; i++) { AbstractCard tCard = AbstractDungeon.Player.DiscardPile.Group[i]; if (tCard.Type == CardType.Skill) { tCard.ModifyCostForCombat(-9); } } for (int i = 0; i < AbstractDungeon.Player.ExhaustPile.Group.Count; i++) { AbstractCard tCard = AbstractDungeon.Player.ExhaustPile.Group[i]; if (tCard.Type == CardType.Skill) { tCard.ModifyCostForCombat(-9); } } } GameActionType = ActionType.Power; GameAttackEffect = _attackEffect; if (AbstractDungeon.GetMonsters().AreMonstersBasicallyDead()) { IsDone = true; } }
public void EventAttackSlash() { AttackEffect script = PrefabManager.Instance.MakeScript <AttackEffect>(game_chara_main.m_prefAttack, game_chara_main.m_goAttackRoot); script.transform.localPosition = new Vector3(0.0f, 0.0f, -1.0f); script.transform.localScale = Vector3.one * 2.0f; script.Initialize(game_chara_main.m_dataUnitParam, null, "enemy", game_chara_main.m_masterWeaponParam); }
public AttackEffect theEffect; //the effect itself public void copy(BattleMove other) //a copy constructor { this.theType = other.theType; this.moveName = other.moveName; this.movePower = other.movePower; this.moveMpCost = other.moveMpCost; this.moveSpCost = other.moveSpCost; this.theEffect = other.theEffect; }
public void EventAttackSlash() { //Debug.Log("EventAttackSlash"); AttackEffect script = PrefabManager.Instance.MakeScript <AttackEffect>(GameMain.Instance.player_chara.m_prefAttack, enemy.m_posAttack); script.transform.localPosition = new Vector3(0.0f, 0.0f, -1.0f); script.transform.localScale = Vector3.one * 2.0f; script.Initialize(enemy.dataUnitParam, null, "player", null); }
public Taunt(string name, string description, int cost, UniqueEffect effectFunction) { //Sets up fields this.name = name; this.description = description; this.cost = cost; //Sets effect function boostAttack = null; uniqueFunction = effectFunction; }
void CreateAttackREffect(Vector2 UnitPos) { if (RusoREffectSample) { GameObject RusoREffect = Instantiate(RusoREffectSample, UnitPos * ZDGameRule.UNIT_IN_WORLD, Quaternion.identity); AttackEffect RusoREffectScript = RusoREffect.GetComponent <AttackEffect>(); if (RusoREffectScript) { RusoREffectScript.AttackDamages = new float[] { GetFinalAttackDamage(EAttackType.R) }; } } }
// END ENUMERATIONS //CONSTRUCTORS public TurretBehaviour() { maxHealth = 100; currentHealth = maxHealth; range = 1; attackDamage = 1; attackSpeed = 1; attackTargetType = AttackTargetType.Single; attackEffect = AttackEffect.None; killCount = 0; abilityPoints = 0; }
public void InitAttackWithId(int id) { SkillData data = skillsDict[id]; if (data.ActualCd == 0) { data.ActualCd = data.Cooldown; AttackEffect attackEffectPrefab = STF.GameManager.AttacksDB.GetAttackEffectWithId(data.SkillEffectId); AttackEffect attack = Instantiate(attackEffectPrefab, transform.position, Quaternion.identity); attack.InitData(data.Damage); } }
private void UpdateSFX() { if (playedSFX) { return; } playedSFX = true; int attackNumber = Controller.State.AttackNumber; AttackEffect effect = ActiveSkin.GetAttackEffect(attackNumber); Controller.Animator.PlayMeleeSFX(effect.AttackSFX[0], effect.AttackVolume); }
public AttackEffect GetAttackEffectWithId(int id) { for (int i = 0; i < AttackEffectsPrefabs.Count; i++) { AttackEffect prefab = AttackEffectsPrefabs[i]; if (prefab.Id == id) { return(prefab); } } Debug.LogWarning("Can't find attack prefab with id " + id); return(null); }
public void SetUp() { BeingCreator = SourceMe.The <IBeingCreator>(); Basis.ConnectIDGenerator(); // Torch as club, crunch and burn tac = new AttackMethod(); tac_impact = new AttackEffect { Type = "physical.impact.blunt", DamageRange = "1d5" }; tac_flame = new AttackEffect { Type = "energetic.fire", DamageRange = "1d3 - 1" }; tac.AttackEffects.Add(tac_impact); tac.AttackEffects.Add(tac_flame); // Brekka-onu's Flame Hammer, bigger crunch, bigger burn bfh = new AttackMethod(); bfh_impact = new AttackEffect { Type = "physical.impact.blunt", DamageRange = "2d6 + 4" }; bfh_flame = new AttackEffect { Type = "energetic.fire", DamageRange = "1d4 + 2" }; bfh.AttackEffects.Add(bfh_impact); bfh.AttackEffects.Add(bfh_flame); leather_armor = new DefenseMethod(); leather_armor.Resistances["physical.impact.blunt"] = "1/4 ..4"; leather_armor.Resistances["physical"] = "1/2 ..4"; leather_armor.Resistances["energetic"] = "2/3 ..4"; leather_armor.Resistances["magical"] = "1/3 ..1"; leather_armor.Resistances["vital"] = "1/3 ..2"; //leather_armor.Resistances["default"] = "1/3 ..3"; //not needed with all branches covered ring_armor = new DefenseMethod(); ring_armor.Resistances["physical.impact.blunt"] = "1/2 ..6"; ring_armor.Resistances["physical"] = "2/3 ..8"; ring_armor.Resistances["energetic.fire"] = "2/3 ..5"; ring_armor.Resistances["default"] = "1/2 ..5"; //0.2: Keep the tree of damage types in data, and type-check attacks/defenses at load time... }
private Sprite GetSprite(AttackEffect effect) { switch (effect) { case AttackEffect.PARALYZE: return(Images[6]); case AttackEffect.STUN: return(Images[7]); case AttackEffect.POISON: return(Images[8]); case AttackEffect.TAUNT: return(Images[9]); } return(null); }
void Start() { var playerAttack = new PlayerAttack(); var attackEffect = new AttackEffect(); var attackMotion = new AttackMotion(); var playerAttackManager = new PlayerAttackManager(playerAttack, attackEffect, attackMotion); // サブシステムの機能をカプセル化した「攻撃する」という一連の処理を行うメソッド playerAttackManager.Attack(); // サブシステムの個々のメソッドもアクセスはできる playerAttack.Attack(); attackEffect.ShowAttackEffect(); attackMotion.PlayAttackMotion(); }
public AttackEffect GetEffect() { AttackEffect attack = null; if (attackPool.Count > 0) { attack = attackPool.Dequeue(); attack.gameObject.SetActive(true); } else { attack = Instantiate(prefab); } return(attack); }
private static void DefineAttack(ActorType type,int cost,int damage_dice,AttackEffect crit,string message,string miss_message,string armor_blocked_message,params AttackEffect[] effects) { if(attack[type] == null){ attack[type] = new List<AttackInfo>(); } attack[type].Add(new AttackInfo(cost,damage_dice,crit,message,miss_message,armor_blocked_message,effects)); //monsters will try to use attack 0 while confused, so the first one should be a basic attack when possible. }
public AttackInfo(int cost_,int dice_,AttackEffect crit_,string hit_,string miss_,string blocked_,params AttackEffect[] effects_) { cost = cost_; damage.dice = dice_; damage.type = DamageType.NORMAL; damage.damclass = DamageClass.PHYSICAL; crit = crit_; hit = hit_; miss = miss_; blocked = blocked_; if(effects_.GetLength(0) > 0){ effects = new List<AttackEffect>(); foreach(AttackEffect ae in effects_){ effects.Add(ae); } } }
public HitDef(StateSystem statesystem, String label, TextSection textsection) : base(statesystem, label, textsection) { m_hitattr = textsection.GetAttribute<Combat.HitAttribute>("attr", null); m_hitflag = textsection.GetAttribute<Combat.HitFlag>("hitflag", Combat.HitFlag.Default); m_guardflag = textsection.GetAttribute<Combat.HitFlag>("guardflag", Combat.HitFlag.Default); m_affectteam = textsection.GetAttribute<AffectTeam>("affectteam", AffectTeam.Enemy); m_hitanimtype = textsection.GetAttribute<HitAnimationType>("animtype", HitAnimationType.Light); m_airhitanimtype = textsection.GetAttribute<HitAnimationType>("air.animtype", HitAnimationType); m_fallhitanimtype = textsection.GetAttribute<HitAnimationType>("fall.animtype", (AirHitAnimationType == HitAnimationType.Up) ? HitAnimationType.Up : HitAnimationType.Back); m_priority = textsection.GetAttribute<Combat.HitPriority>("priority", Combat.HitPriority.Default); m_damage = textsection.GetAttribute<Evaluation.Expression>("damage", null); m_pausetime = textsection.GetAttribute<Evaluation.Expression>("pausetime", null); m_guardpausetime = textsection.GetAttribute<Evaluation.Expression>("guard.pausetime", null); m_sparknumber = textsection.GetAttribute<Evaluation.PrefixedExpression>("sparkno", null); m_guardsparknumber = textsection.GetAttribute<Evaluation.PrefixedExpression>("guard.sparkno", null); m_sparkposition = textsection.GetAttribute<Evaluation.Expression>("sparkxy", null); m_hitsound = textsection.GetAttribute<Evaluation.PrefixedExpression>("hitsound", null); m_guardhitsound = textsection.GetAttribute<Evaluation.PrefixedExpression>("guardsound", null); m_attackeffect = textsection.GetAttribute<AttackEffect>("ground.type", AttackEffect.High); m_aireffect = textsection.GetAttribute<AttackEffect>("air.type", GroundAttackEffect); m_groundslidetime = textsection.GetAttribute<Evaluation.Expression>("ground.slidetime", null); m_guardslidetime = textsection.GetAttribute<Evaluation.Expression>("guard.slidetime", null); m_groundhittime = textsection.GetAttribute<Evaluation.Expression>("ground.hittime", null); m_guardhittime = textsection.GetAttribute<Evaluation.Expression>("guard.hittime", null); m_airhittime = textsection.GetAttribute<Evaluation.Expression>("air.hittime", null); m_guardctrltime = textsection.GetAttribute<Evaluation.Expression>("guard.ctrltime", null); m_guarddistance = textsection.GetAttribute<Evaluation.Expression>("guard.dist", null); m_yaccel = textsection.GetAttribute<Evaluation.Expression>("yaccel", null); m_groundvelocity = textsection.GetAttribute<Evaluation.Expression>("ground.velocity", null); m_guardvelocity = textsection.GetAttribute<Evaluation.Expression>("guard.velocity", null); m_airvelocity = textsection.GetAttribute<Evaluation.Expression>("air.velocity", null); m_airguardvelocity = textsection.GetAttribute<Evaluation.Expression>("airguard.velocity", null); m_groundcornerpushoff = textsection.GetAttribute<Evaluation.Expression>("ground.cornerpush.veloff", null); m_aircornerpushoff = textsection.GetAttribute<Evaluation.Expression>("air.cornerpush.veloff", null); m_downcornerpushoff = textsection.GetAttribute<Evaluation.Expression>("down.cornerpush.veloff", null); m_guardcornerpushoff = textsection.GetAttribute<Evaluation.Expression>("guard.cornerpush.veloff", null); m_airguardcornerpushoff = textsection.GetAttribute<Evaluation.Expression>("airguard.cornerpush.veloff", null); m_airguardctrltime = textsection.GetAttribute<Evaluation.Expression>("airguard.ctrltime", null); m_airjuggle = textsection.GetAttribute<Evaluation.Expression>("air.juggle", null); m_mindistance = textsection.GetAttribute<Evaluation.Expression>("mindist", null); m_maxdistance = textsection.GetAttribute<Evaluation.Expression>("maxdist", null); m_snap = textsection.GetAttribute<Evaluation.Expression>("snap", null); m_p1spritepriority = textsection.GetAttribute<Evaluation.Expression>("p1sprpriority", null); m_p2spritepriority = textsection.GetAttribute<Evaluation.Expression>("p2sprpriority", null); m_p1facing = textsection.GetAttribute<Evaluation.Expression>("p1facing", null); m_p1getp2facing = textsection.GetAttribute<Evaluation.Expression>("p1getp2facing", null); m_p2facing = textsection.GetAttribute<Evaluation.Expression>("p2facing", null); m_p1statenumber = textsection.GetAttribute<Evaluation.Expression>("p1stateno", null); m_p2statenumber = textsection.GetAttribute<Evaluation.Expression>("p2stateno", null); m_p2getp1state = textsection.GetAttribute<Evaluation.Expression>("p2getp1state", null); m_forcestand = textsection.GetAttribute<Evaluation.Expression>("forcestand", null); m_fall = textsection.GetAttribute<Evaluation.Expression>("fall", null); m_fallxvelocity = textsection.GetAttribute<Evaluation.Expression>("fall.xvelocity", null); m_fallyvelocity = textsection.GetAttribute<Evaluation.Expression>("fall.yvelocity", null); m_fallrecover = textsection.GetAttribute<Evaluation.Expression>("fall.recover", null); m_fallrecovertime = textsection.GetAttribute<Evaluation.Expression>("fall.recovertime", null); m_falldamage = textsection.GetAttribute<Evaluation.Expression>("fall.damage", null); m_airfall = textsection.GetAttribute<Evaluation.Expression>("air.fall", null); m_downvelocity = textsection.GetAttribute<Evaluation.Expression>("down.velocity", null); m_downhittime = textsection.GetAttribute<Evaluation.Expression>("down.hittime", null); m_downbounce = textsection.GetAttribute<Evaluation.Expression>("down.bounce", null); m_targetid = textsection.GetAttribute<Evaluation.Expression>("id", null); m_chainid = textsection.GetAttribute<Evaluation.Expression>("chainid", null); m_nochainid = textsection.GetAttribute<Evaluation.Expression>("nochainid", null); m_hitonce = textsection.GetAttribute<Evaluation.Expression>("hitonce", null); m_kill = textsection.GetAttribute<Evaluation.Expression>("kill", null); m_guardkill = textsection.GetAttribute<Evaluation.Expression>("guard.kill", null); m_fallkill = textsection.GetAttribute<Evaluation.Expression>("fall.kill", null); m_numberofhits = textsection.GetAttribute<Evaluation.Expression>("numhits", null); m_p1powerincrease = textsection.GetAttribute<Evaluation.Expression>("getpower", null); m_p2powerincrease = textsection.GetAttribute<Evaluation.Expression>("givepower", null); m_paltime = textsection.GetAttribute<Evaluation.Expression>("palfx.time", null); m_palmul = textsection.GetAttribute<Evaluation.Expression>("palfx.mul", null); m_paladd = textsection.GetAttribute<Evaluation.Expression>("palfx.add", null); m_palsinadd = textsection.GetAttribute<Evaluation.Expression>("palfx.sinadd", null); m_palinvert = textsection.GetAttribute<Evaluation.Expression>("palfx.invertall", null); m_palcolor = textsection.GetAttribute<Evaluation.Expression>("palfx.color", null); m_shaketime = textsection.GetAttribute<Evaluation.Expression>("envshake.time", null); m_shakefreq = textsection.GetAttribute<Evaluation.Expression>("envshake.freq", null); m_shakeamplitude = textsection.GetAttribute<Evaluation.Expression>("envshake.ampl", null); m_shakephaseoffset = textsection.GetAttribute<Evaluation.Expression>("envshake.phase", null); m_fallshaketime = textsection.GetAttribute<Evaluation.Expression>("fall.envshake.time", null); m_fallshakefreq = textsection.GetAttribute<Evaluation.Expression>("fall.envshake.freq", null); m_fallshakeamplitude = textsection.GetAttribute<Evaluation.Expression>("fall.envshake.ampl", null); m_fallshakephaseoffset = textsection.GetAttribute<Evaluation.Expression>("fall.envshake.phase", null); m_attackwidth = textsection.GetAttribute<Evaluation.Expression>("attack.width", null); #warning Note this. #if EMULATE_ENGINE_BUG if (m_hitanimtype == HitAnimationType.Back) m_hitanimtype = HitAnimationType.Hard; m_palcolor = null; #endif }
public override void DoAttack(AttackEffect ae) { if (character.curState == animToState[ae.name]) { return; } if (ae.name == "atk_far") { m_SkeletonAnim.AnimationName = ae.name; m_SkeletonAnim.state.GetCurrent(0).loop = false; } else base.DoAttack(ae); ChangeState(); }
private static void DefineAttack(ActorType type,int cost,int damage_dice,AttackEffect crit,string message,params AttackEffect[] effects) { DefineAttack(type,cost,damage_dice,crit,message,"","",effects); }
public override void release(KGCharacterController releaser, AttackEffect ae) { skeletonAnim.AnimationName = ae.name; skeletonAnim.timeScale = ae.timeScale; m_attack = new Attack(releaser, ae, releaser.character.xDirection); }
public void TakeDamage(float damage, AttackEffect[] attackEffects) { if (enemyState != EnemyStates.Dead){ behaviourCoroutine = this.StartSafeCoroutine(Damaged(damage, attackEffects)); } }
IEnumerator WaitForAttackEffects(AttackEffect[] attackEffects) { SafeCoroutine[] coroutines = new SafeCoroutine[attackEffects.Length]; for (int i = 0; i < attackEffects.Length; i++){ coroutines[i] = attackEffects[i].InvokeEffect(gameObject); } while (coroutines.Any(x => x.IsRunning)){ yield return null; } }
IEnumerator Damaged(float damage, AttackEffect[] attackEffects) { var previousState = enemyState; enemyState = EnemyStates.Damaged; animateEnemy.Damage(); attackDelayStartTime = Time.time; health -= damage; if (attackEffects.Length > 0){ yield return this.StartSafeCoroutine(WaitForAttackEffects(attackEffects)); } yield return new WaitForSeconds(damageDuration); if (health > 0){ animateEnemy.Inactive(); enemyState = previousState; } }
public virtual void release(KGCharacterController releaser, AttackEffect ae) { transform.localScale = new Vector3(releaser.transform.localScale.x * Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); m_attack = new Attack(releaser, ae, releaser.character.xDirection); }
public Attack(KGCharacterController releaser, AttackEffect attackInfo, float direction) { m_Releaser = releaser; m_AttackEffect = attackInfo; this.direction = direction; }
public Attack(KGCharacterController releaser, AttackEffect attackInfo, int direction) { this.releaser = releaser; atkEffect = attackInfo; this.direction = direction; }