//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);
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     audioSource = GetComponent<AudioSource>();
     audioSource.volume = PlayerPrefsManager.GetMasterVolume();
     anim = GetComponent<Animator>();
     attacker = GetComponent<Attacker>();
 }
Esempio n. 3
0
 public ViewModel(Attacker attacker, DamageDistribution damageDistribution)
 {
     _damageDistribution = damageDistribution;
       _assignments = new BlockerDamageAssignments(attacker);
       _attacker = attacker;
       _totalDamageToAssign = attacker.Card.CalculateCombatDamageAmount();
       _damageLeftToAssign = _totalDamageToAssign;
 }
Esempio n. 4
0
	// Use this for initialization
	void Start () {
		anim = GetComponent<Animator>();
		attacker = GetComponent<Attacker>();
		audioSource = GetComponent<AudioSource>();
		if(!audioSource) {
			audioSource = gameObject.AddComponent<AudioSource>();
		}
	}
Esempio n. 5
0
	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>();
 }
Esempio n. 7
0
	// 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();
            }           
        }
    }
Esempio n. 8
0
        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);
 }
Esempio n. 10
0
    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;
        }
    }
Esempio n. 11
0
	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();
	}
Esempio n. 12
0
 public AttackerDecorator(Attacker enemy)
 {
     this.decoratedAttacker = enemy;
 }
Esempio n. 13
0
 // Use this for initialization
 void Awake()
 {
     mover = this.GetComponent<Mover>();
     FSM = this.GetComponent<FiniteStateMachine>();
     attacker = this.GetComponent<Attacker>();
 }
Esempio n. 14
0
    private void Spawn(Attacker myAttacker)
    {
        Attacker newAttacker = Instantiate(myAttacker, transform.position, transform.rotation) as Attacker;

        newAttacker.transform.parent = transform;
    }
Esempio n. 15
0
 public abstract void OnAttacked(Attacker attacker, float force);
Esempio n. 16
0
 // Use this for initialization
 void Start()
 {
     animator = GetComponent <Animator>();
     attacker = GetComponent <Attacker>();
 }
Esempio n. 17
0
	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;
	}
Esempio n. 18
0
 // Use this for initialization
 void Start()
 {
     foxAnimator    = GetComponent <Animator>();
     parentAttacker = GetComponentInParent <Attacker>();
 }
Esempio n. 19
0
 private void Awake()
 {
     attacker = GetComponent <Attacker>();
     animator = GetComponentInChildren <Animator>();
 }
Esempio n. 20
0
    private void SpawnAttacker()
    {
        Attacker newAttacker = Instantiate(RandomSpawn(), transform.position, transform.rotation) as Attacker;

        newAttacker.transform.parent = transform;
    }
Esempio n. 21
0
 // Use this for initialization
 void Start()
 {
     // Obtain the animator and attacker scripts
     anim     = GetComponent <Animator>();
     attacker = GetComponent <Attacker>();
 }
Esempio n. 22
0
    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();
    }
Esempio n. 23
0
 // Use this for initialization
 void Start()
 {
     anim     = gameObject.GetComponent <Animator> ();
     attacker = gameObject.GetComponent <Attacker> ();
 }
 private void Awake()
 {
     attacker = GetComponent<Attacker>();
 }
Esempio n. 25
0
	public virtual void SetCurrentAttacker(Attacker attacker)
	{
		Target = attacker;
	}
Esempio n. 26
0
 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;
 }
Esempio n. 28
0
    private void SpawnEnemy()
    {
        Attacker newAttacker = Instantiate(GetEnemy(), transform.position, transform.rotation) as Attacker;

        newAttacker.transform.parent = transform;
    }
Esempio n. 29
0
	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);
	}
Esempio n. 30
0
    private void Spawn(Attacker attackerPrefab)
    {
        Attacker newAttacker = Instantiate(attackerPrefab, gameObject.transform.position, Quaternion.identity) as Attacker;

        newAttacker.transform.parent = transform;
    }
Esempio n. 31
0
    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!
    }
Esempio n. 32
0
    // 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);
        }
    }
Esempio n. 33
0
 void Start()
 {
     this._attacker = this.GetComponent <Attacker>();
 }
Esempio n. 34
0
 void OnAttackerTimeoutWarning(Attacker attacker)
 {
     voAudioSource.PlayOneShot(voCountdownWarning[voVariationIndex % voHit.Length]);
 }
Esempio n. 35
0
 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;
 }
Esempio n. 38
0
 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);
 }
Esempio n. 40
0
    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.
    }
Esempio n. 41
0
 internal AttackStartedEventArgs(Attacker attacker)
 {
     Attacker = attacker;
 }
Esempio n. 42
0
    public void SpawnAttacker()
    {
        Attacker newAttacker = Instantiate(attackerSpawn, transform.position, transform.rotation) as Attacker;

        newAttacker.transform.parent = transform;
    }
Esempio n. 43
0
 public override void OnAttacked(Attacker attacker, float force)
 {
     Vector3 awayFromHitter = (rigd.position - attacker.MyTr.position).normalized;
     rigd.velocity += force * ForceMultiplier * awayFromHitter;
 }
Esempio n. 44
0
 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;
 }
Esempio n. 46
0
 // Start is called before the first frame update
 void Start()
 {
     attacker = GetComponentInParent <Attacker>();
 }
Esempio n. 47
0
	//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;
	}
Esempio n. 48
0
 private static bool IsPlayer(Attacker arg)
 {
     return(arg.CharacterID != 0);
 }
Esempio n. 49
0
 // Use this for initialization
 void Start()
 {
     attacker = GetComponent<Attacker>();
 }
 public AttackerJoinedCombatEvent(Attacker attacker, bool wasDeclared)
 {
     Attacker = attacker;
       WasDeclared = wasDeclared;
 }
Esempio n. 51
0
	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;
	}
Esempio n. 52
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator> ();
     attacker = GetComponent<Attacker> ();
     DetectDifficulty ();
 }
Esempio n. 53
0
	protected virtual IEnumerator Die(Attacker attacker)
	{
		yield return null;
		if (ReleaseSoulWhenDead)
			ReleaseSouls(attacker.Owner);
		Despawn();
	}
Esempio n. 54
0
 private void Start()
 {
     ANIMSTATE = ANIM_STATE.IDLE;
     animator  = GetComponent <Animator>();
     attacker  = GetComponent <Attacker>();
 }
Esempio n. 55
0
 private static bool IsGateCampShip(Attacker attacker)
 {
     return(Types.IsGateCampShip(attacker.ShipTypeID, attacker.WeaponTypeID));
 }
Esempio n. 56
0
 public FreezingAttacker(Attacker decoratedAttacker) : base(decoratedAttacker)
 {
 }
Esempio n. 57
0
    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);
    }
Esempio n. 58
0
 // Start is called before the first frame update
 void Start()
 {
     attacker = transform.parent.GetComponent <Attacker>();
 }
Esempio n. 59
0
 // Use this for initialization
 void Start()
 {
     foxAnimator = GetComponent<Animator>();
     attacker = GetComponent<Attacker>();
 }
Esempio n. 60
0
    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);
    }