protected virtual void giveCharacterBuff(BaseCharacterBehavior character) { int stationCount = 1; bool isGarrisoner = false; for (int i = 0; i < stationNPC.Length; i++) { if (stationNPC[i] != null && stationNPC[i].IsInGarrison) { stationCount++; if (stationNPC[i] == character) { isGarrisoner = true; } } } if (Tags.IsCompanion(this, character)) { //Buff //全第一屬性+5% *駐防數+1 //生命回復+50%,能量/法力回復+10% * 駐防數+1 //視野400%(駐防者)/200%(一般) //造成傷害+10%(駐防者)/+5%(一般) * 駐防數+1 //傷害降低 塔的傷害降低的一半(駐防者)/(5%*駐防數+1) BuffSkill buff = new BuffSkill(SkillName.WarBlessing, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] { new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, .05f * stationCount), new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, .05f * stationCount), new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, .05f * stationCount), new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, .05f * stationCount), new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, .05f * stationCount), new Buff(SecondaryAttributeName.HealthRecoverRate, Buff.BuffType.Relative, .5f * stationCount), new Buff(SecondaryAttributeName.EnergyRecoverRate, Buff.BuffType.Relative, .1f * stationCount), new Buff(SecondaryAttributeName.ManaRecoverRate, Buff.BuffType.Relative, .1f * stationCount), new Buff(SecondaryAttributeName.Vision, Buff.BuffType.Relative, isGarrisoner?3f: 1f), new Buff(StaticAttributeName.DamageMake, Buff.BuffType.Absolute, (isGarrisoner?.1f : .05f) * stationCount), new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, -(isGarrisoner?DamageReduce : .05f * stationCount)) }, false); buff.SetCaster(character); buff.Cast(character); } else { //Debuff //全第一屬性-5% *1+駐防數 //受到傷害+3% * 駐防數 BuffSkill buff = new BuffSkill(SkillName.WarRepression, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] { new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, -.05f * stationCount), new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, -.05f * stationCount), new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, -.05f * stationCount), new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, -.05f * stationCount), new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, -.05f * stationCount), new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, .03f * (stationCount - 1)) }, false); buff.SetCaster(character); buff.Cast(character); } }
protected override void AddEffectOnWeaponHit(Damagable character) { if (character.GetComponent <BaseCharacterBehavior>() != null) { BuffSkill sk = CreateArmorBreakDebuff(); sk.SetCaster(user); //Debug.Log(target.name + "on debuff"); sk.Cast(character.GetComponent <BaseCharacterBehavior>()); } }
protected override void giveCharacterBuff(BaseCharacterBehavior character) { if (Tags.IsCompanion(this, character)) { //Buff //全第一屬性+5% *駐防數+1 //生命回復+50%,能量/法力回復+10% * 駐防數+1 //視野400%(駐防者)/200%(一般) //造成傷害+10%(駐防者)/+5%(一般) * 駐防數+1 //傷害降低 塔的傷害降低的一半(駐防者)/(5%*駐防數+1) BuffSkill buff = new BuffSkill(SkillName.WarBlessing, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] { new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, .2f), new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, .2f), new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, .2f), new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, .2f), new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, .2f), new Buff(SecondaryAttributeName.HealthRecoverRate, Buff.BuffType.Relative, 2f), new Buff(SecondaryAttributeName.EnergyRecoverRate, Buff.BuffType.Relative, .4f), new Buff(SecondaryAttributeName.ManaRecoverRate, Buff.BuffType.Relative, .4f), new Buff(SecondaryAttributeName.Vision, Buff.BuffType.Relative, 3f), new Buff(StaticAttributeName.DamageMake, Buff.BuffType.Absolute, .4f), new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, -.2f) }, false); buff.SetCaster(character); buff.Cast(character); } else { //Debuff //全第一屬性-5% *1+駐防數 //受到傷害+3% * 駐防數 BuffSkill buff = new BuffSkill(SkillName.WarRepression, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] { new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, -.2f), new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, -.2f), new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, -.2f), new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, -.2f), new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, -.2f), new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, .1f) }, false); buff.SetCaster(character); buff.Cast(character); } }
protected virtual void Update() { if (waitColliderRangeIniTimer != 0 && Time.time - waitColliderRangeIniTimer > waitColliderRangeIniTime) { //Debug.Log("collider蒐集完資料惹"); waitColliderRangeIniTimer = 0; skillCollider.radius = 0; skillCollider.enabled = false; targetInRange = GetTargetInRange(npcInArea); npcInArea.Clear(); if (targetInRange == null) { return; } // targetInRange = user; targetPos = targetInRange.transform.position; moveDir = targetPos - transform.position; } if (targetInRange != null) { if ((targetPos - transform.position).magnitude > moveDir.magnitude * Time.deltaTime) { if (!ImmediateMoveToTarget) { transform.position += moveDir * Time.deltaTime;//一秒到達 } else { transform.position += moveDir; } } else { //已到達, 展開area radious skillCollider.radius = Radius; skillCollider.enabled = true; waitColliderRadiouIniTimer = Time.time; targetInRange = null; if (SkillHitOnTargerEffectPrefab != null) { GameObject.Instantiate(SkillHitOnTargerEffectPrefab, targetPos, Quaternion.identity); } //Debug.Log("開始蒐集radious 候過waitColliderRadiouIniTime時間"); } } if (waitColliderRadiouIniTimer != 0 && Time.time - waitColliderRadiouIniTimer > waitColliderRadiouIniTime) { //Debug.Log("幫npc上效果"); waitColliderRadiouIniTimer = 0; List <BaseCharacterBehavior> targetsInRadious = GetTargetInRadious(npcInArea); foreach (BaseCharacterBehavior target in targetsInRadious) { BuffSkill sk = Createbuff(); if (sk != null) { sk.SetCaster(user); //Debug.Log("幫 "+ target.CharacterName+ " 上效果"); sk.Cast(target); target.Damage(EffectDamageType, this, user); } } } }