public override void useSkill(List <BattleChar> target) { base.useSkill(target); foreach (BattleChar bc in target) { DamCoef = 0.7f + 0.05f * level; bc.setLastAttack(set.user); bc.getTarget().SetMagicDamage(set.user, DamCoef, level, coef * set.BuffedDamage(set.user.getFinalDamage() * CriticalTest(), bc)); ((SkillArcher)set).lastTarget = bc; if (enemies.Exists(x => x == bc)) { skills.ToArray()[enemies.IndexOf(bc)].setTurn(3); } else { Bleed b = new Bleed(3, set.user, bc, set.user.GetMgcATK() * (0.3f + 0.02f * level)); enemies.Add(bc); skills.Add(b); bc.stateBleed.Add(b); } } }
/** * There is a debug code. * incomplete:: shld be read settings file */ protected override void Start() { base.Start(); Debug.Log("개 나타남"); hpDB = new int[6] { 19, 22, 41, 47, 72, 81 }; atkDB = new int[6] { 3, 3, 5, 6, 9, 11 }; defDB = new int[6] { 1, 1, 2, 2, 3, 3 }; debuffDB = new float[6] { 0.0f, 0.0f, 0.1f, 0.1f, 0.4f, 0.4f }; hDebuffDB = new float[6] { 0.25f, 0.25f, 0.45f, 0.45f, 0.9f, 0.9f }; level = boardManager.WhichFloor; attack = atkDB[level]; //shld be decided by level and setting file defense = defDB[level]; maxhp = hpDB[level]; hp = maxhp; debuffPercent = debuffDB[level]; enemyAction = new EnemyAction(this); debuff = new Bleed(3); player = GameObject.Find("Player").GetComponent <Player>(); }
public void RunEffects() { map.selectedEnemy = this.name; GameObject effects = GameObject.Find("Effects"); if (Burned) { // map.selectedEnemy = this.name; // Burn burn = effects.GetComponent <Burn> (); burn.RunBurn(); } if (Slowed) { // map.selectedEnemy = this.name; // GameObject Slow = GameObject.Find ("_Scripts"); Slow slow = effects.GetComponent <Slow> (); slow.RunSlow(); } if (Poisoned) { // map.selectedEnemy = this.name; // GameObject Poison = GameObject.Find ("_Scripts"); Poison poison = effects.GetComponent <Poison> (); poison.RunPoison(); } if (Bleeding) { // map.selectedEnemy = this.name; // GameObject Bleed = GameObject.Find ("_Scripts"); Bleed bleed = effects.GetComponent <Bleed> (); bleed.RunBleed(); } if (Stunned) { // map.selectedEnemy = this.name; // GameObject Stun = GameObject.Find ("_Scripts"); Stun stun = effects.GetComponent <Stun> (); stun.RunStun(); } if (Chilled) { Chill chill = effects.GetComponent <Chill> (); chill.RunChill(); } if (Frozen) { Frozen frozen = effects.GetComponent <Frozen> (); frozen.RunFrozen(); } if (Blinded) { Blind blind = effects.GetComponent <Blind> (); blind.RunBlind(); } }
public virtual float CriticalTest(BattleChar user) { float critValue = base.CriticalTest(); if (critValue > 1.0f && ((NormalEnemyPassives)set.pas[3]).isInit) { Bleed bd = new Bleed(3, set.user, user, user.DC.getMaxHP() * 0.05f); user.stateBleed.Add(bd); } return(critValue); }
public void onHit(int _demage, int num = 1) { float _delay = 0.0f; for (int i = 0; i < num; i++) { Loom.QueueOnMainThread(() => { if (PropertyDic [Property.HP] > 0) { Bleed bleed = (Bleed)PoolManager.getInstance().getGameObject("Bleed"); if (_demage > 0) { iTween.ShakePosition(style.gameObject, new Vector3(5.0f, 5.0f, 0.0f), 0.2f); bleed.blood.color = DataManager.getInstance().getColor("red"); } else { //加血 bleed.blood.color = DataManager.getInstance().getColor("green"); } int buffhp = PropertyAddByBuffDic [Property.HP]; //护盾 buffhp = buffhp - _demage; PropertyAddByBuffDic [Property.HP] = buffhp < 0 ? 0 : buffhp; if (buffhp < 0 || _demage < 0) { int hp = PropertyDic [Property.HP]; int maxhp = PropertyDic [Property.MAXHP]; hp = hp + buffhp; hp = hp >= 0 ? hp : 0; hp = hp >= maxhp ? maxhp : hp; float xscale = (float)hp / (float)maxhp; HP.transform.localScale = new Vector3(xscale, 1, 1); HPTxt.text = (Math.Ceiling(xscale * 100)).ToString() + "%"; PropertyDic [Property.HP] = hp; } else { buffhp = 0; } bleed.transform.SetParent(this.transform); bleed.show(buffhp, () => { if (PropertyDic [Property.HP] == 0) { onDead(); } pvescene.checkBout(); }); } }, _delay); _delay += 0.3f; } }
// Update is called once per frame void Update() { Bleed bl = GetComponentInParent <Enemy>().GetComponentInChildren <Bleed>(); if (bl != null) { image.enabled = true; image.fillAmount = bl.lifeTime.Remaining / bl.lifeTime.Remaining; } else { image.enabled = false; } }
public void showPropertyChange(Property changeEntityProperty, int _changeValue, int valueType) { Bleed bleed = (Bleed)PoolManager.getInstance().getGameObject("Bleed"); if (_changeValue > 0) { bleed.blood.color = DataManager.getInstance().getColor("green"); } else { bleed.blood.color = DataManager.getInstance().getColor("red"); } bleed.transform.SetParent(this.transform); string str = ""; switch (valueType) { case 0: str = DataManager.getInstance().languageJson [10011 + (int)changeEntityProperty] ["name"].ToString() + _changeValue.ToString(); if (changeEntityProperty == Property.HP) { if (PropertyDic [Property.HP] > PropertyDic [Property.MAXHP]) { PropertyDic [Property.HP] = PropertyDic [Property.MAXHP]; } float xscale = (float)PropertyDic [Property.HP] / (float)PropertyDic [Property.MAXHP]; HP.transform.localScale = new Vector3(xscale, 1, 1); HPTxt.text = (Math.Ceiling(xscale * 100)).ToString() + "%"; } break; case 1: str = DataManager.getInstance().languageJson [10023 + (int)changeEntityProperty]["name"].ToString() + _changeValue.ToString(); break; case 2: str = DataManager.getInstance().languageJson [10035 + (int)changeEntityProperty]["name"].ToString() + _changeValue.ToString(); break; default: break; } bleed.show(str, () => { if (PropertyDic [Property.HP] == 0) { onDead(); } pvescene.checkBout(); }); }
protected override void Start() { Debug.Log("간호사 등장"); base.Start(); level = 1; defaultA = attack = 6; //shld be decided by level and setting file defaultD = defense = 1; maxhp = 450; hp = maxhp; debuffPercent = 0.0f; enemyAction = new NurseAction(this); debuff = new Bleed(3); player = GameObject.Find("Player").GetComponent <Player> (); atkBuffTurn = 0; atkBuffOn = false; delA = 4; delD = 1; }
public void initMonster() { MonsterManager.getInstance().initMonsterData(ChapterManager2.getInstance().monsterPath); PveMonsterList.Clear(); ArrayList monsterArr = MonsterManager.getInstance().getPveMonstersByBoShu(monsterBoShu, bg.transform); if (monsterArr.Count > 0) { Bleed bleed = (Bleed)PoolManager.getInstance().getGameObject("Bleed"); bleed.transform.SetParent(bg.transform); bleed.show("第 " + monsterBoShu.ToString() + " 回合", () => { for (int i = 0; i < monsterArr.Count; i++) { string[] oneData = (string[])monsterArr [i]; JsonObject _monsterData = DataManager.getInstance().monsterDicJson [int.Parse(oneData [1])]; PveMonster pvmonster = (PveMonster)PoolManager.getInstance().getGameObject("PveMonster"); //foreach (KeyValuePair<int,PveMonster> kvp in PveMonsterList) { pvmonster.transform.SetParent(bg.transform); pvmonster.transform.localScale = Vector3.one; JsonObject _monsterpos = DataManager.getInstance().pvePosJson [int.Parse(oneData [2])]; pvmonster.transform.localPosition = new Vector3(float.Parse(_monsterpos ["x"].ToString()), float.Parse(_monsterpos ["y"].ToString()), float.Parse(_monsterpos ["z"].ToString())); pvmonster.init(_monsterData, this); PveMonsterList [i] = pvmonster; //} } monsterBoShu++; sortEntityBySpeed(); setNextAttackEntityBySpeed(); }); //Loom.QueueOnMainThread (, 2.0f); } else { gameOver(); //战斗结束 } }
public static Effect GetEffect(string param) { if (effects.ContainsKey(param)) { return(effects[param]); } string[] p = param.Split(' '); switch (p[0]) { case "Bleed": effects[param] = new Bleed(int.Parse(p[1]), int.Parse(p[2])); break; case "Counter": effects[param] = new Counter(float.Parse(p[1]), int.Parse(p[2])); break; case "Heal": effects[param] = new Heal(int.Parse(p[1])); break; case "Defend": case "Defense": effects[param] = new Defend(int.Parse(p[1])); break; case "Mark": effects[param] = new Mark(int.Parse(p[1])); break; case "Push": case "Pull": effects[param] = new PushPull(int.Parse(p[1])); break; case "Move": effects[param] = new Move(); break; case "MoveSelf": effects[param] = new MoveSelf(); break; case "Dodge": case "Damage": case "Crit": case "Acc": case "Speed": case "StressResist": effects[param] = new StatBuff(p[0], float.Parse(p[1]), int.Parse(p[2])); break; case "Block": effects[param] = new Block(int.Parse(p[1]), int.Parse(p[2])); break; case "Stun": effects[param] = new Stun(); break; case "Suprise": effects[param] = new Suprise(); break; case "Stress": case "StressHeal": effects[param] = new Stress(int.Parse(p[1])); break; case "Cleanse": effects[param] = new Cleanse(); break; case "Guard": return(new Guard(int.Parse(p[1]))); case "Metal": return(new Metal(int.Parse(p[1]))); default: Debug.Log(param); break; } return(effects[param]); }
public void RunEffect() { GameObject effects = GameObject.Find("Effects"); switch (effect) { case Effects.ArmorUp: // less inc physical dmg break; case Effects.Burn: Burn burn = effects.GetComponent <Burn> (); damage = burn.Damage(damage, 3); //= damage / 3; burn.ApplyBurn(3, damage); break; case Effects.Bleed: // GameObject Bleed = GameObject.Find ("_Scripts"); Bleed bleed = effects.GetComponent <Bleed> (); bleed.ApplyBleed(); break; case Effects.Chill: // same as slow, but second proc will apply "frozen". Also apply frozen if speed = 0 Chill chill = effects.GetComponent <Chill> (); chill.ApplyChill(); break; case Effects.Slow: // GameObject Slow = GameObject.Find ("_Scripts"); Slow slow = effects.GetComponent <Slow> (); slow.ApplySlow(); break; case Effects.Freeze: // enemy will turns as long as frozen. Burn will neutralize effect. 50% less physical dmg Frozen frozen = effects.GetComponent <Frozen> (); frozen.ApplyFrozen(); break; case Effects.Poison: // GameObject Poison = GameObject.Find ("_Scripts"); Poison poison = effects.GetComponent <Poison> (); poison.damage = damage / 5; poison.ApplyPoison(); break; case Effects.ShieldUp: // block next melee or ranged attack break; case Effects.SpeedUp: // 20% more MS break; case Effects.Stun: // GameObject Stun = GameObject.Find ("_Scripts"); Stun stun = effects.GetComponent <Stun> (); stun.ApplyStun(); break; case Effects.Blind: // GameObject Stun = GameObject.Find ("_Scripts"); Blind blind = effects.GetComponent <Blind> (); blind.Applyblind(); break; case Effects.RemoveBleed: // Remove bleed stacks from target break; case Effects.MagicResUp: // less inc magic dmg break; case Effects.Restoration: // GameObject Restoration = GameObject.Find ("_Scripts"); Restoration restoration = effects.GetComponent <Restoration> (); restoration.heal = healDot; restoration.ApplyRestoration(); break; case Effects.Fly: // walk through objects break; case Effects.FullVision: // see full map break; case Effects.SharedVision: // all players see shared vision break; case Effects.VisionTotem: // tetem taht grands only vision break; case Effects.SpellTotem: // "playable" totem break; case Effects.Cure: // remove all negative effect break; case Effects.AiAlly: // summon AI ally break; case Effects.Empty: break; default: break; } }