Exemplo n.º 1
0
        protected override void OnEnter(object[] param)
        {
            FoxFire foxFire = ( FoxFire )this.owner;

            this._delay = foxFire.battle.random.NextFloat(foxFire.dashDelay, foxFire.dashDelay2);
            this._time  = 0f;
        }
Exemplo n.º 2
0
        protected override void CreateSummons(int triggerIndex)
        {
            BuffData.Summon[][] summonss = this._buff.trigger.summons;

            int index = summonss.Length - 1;

            index = triggerIndex <= index ? triggerIndex : index;

            BuffData.Summon[] summons = summonss[index];

            Battle battle = this._buff.battle;
            int    count  = summons.Length;

            for (int i = 0; i < count; i++)
            {
                BuffData.Summon summon = summons[i];

                Vec3 buffPos = this._buff.property.position;

                float distance = battle.random.NextFloat(this._buff.radius - 0.5f, this._buff.radius + 0.5f);
                Quat  q        = Quat.Euler(0f, battle.random.NextFloat(0f, 360f), 0f);
                Vec3  offset   = q * Vec3.right * distance;
                offset.y = this._buff.caster.size.y * 0.5f;
                FoxFire foxFire = battle.CreateBio <FoxFire>(summon.id, buffPos + offset, this._buff.property.direction, this._buff.caster.property.team);
                foxFire.Setup(this._buff.property.lvl, this._buff.caster, distance);
            }
        }
Exemplo n.º 3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject == target)
        {
            FoxFire foxfire = parent.GetComponent <FoxFire>();
            Units   unit    = parent.GetComponent <Units>();

            float Damage = unit.Attack(AttackType.AP_SKILL, foxfire.skillFactor, foxfire.LevelperValues[foxfire.CurrentLevel].addDamage);
            float Suffer = 0.0f;
            if (other.TryGetComponent <Units>(out var script))
            {
                Suffer = script.hit(AttackType.AP_SKILL, Damage, parent.GetComponent <Units>(), unit.UnitStatus.magicResist);
            }
            Debug.Log("Damage = " + Damage + " / " + "Suffer = " + Suffer);
        }

        Object.Destroy(gameObject);
    }
Exemplo n.º 4
0
        protected override void OnUpdate(UpdateContext context)
        {
            FoxFire foxFire = ( FoxFire )this.owner;

            foxFire.property.Equal(Attr.Position,
                                   Vec3.Normalize(this.angleSpeed * (foxFire.property.position - this.caster.property.position)) *
                                   this.distance + this.caster.property.position);

            this._time += context.deltaTime;

            if (this._time < this._delay)
            {
                return;
            }

            this._time = 0f;

            EntityUtils.GetEntitiesInCircle(foxFire.battle.GetEntities(), foxFire.property.position,
                                            foxFire.detectRange, ref this._temp1);
            EntityUtils.FilterTarget(foxFire, CampType.Hostile | CampType.Neutral, EntityFlag.Hero, ref this._temp1,
                                     ref this._temp2);

            if (this._temp2.Count > 0)
            {
                int index = foxFire.battle.random.Next(0, this._temp2.Count);                  //上限是闭区间
                foxFire.Emmit(( Bio )this._temp2[index]);
            }
            else
            {
                this._temp2.Clear();
                EntityUtils.FilterTarget(foxFire, CampType.Hostile, EntityFlag.SmallPotato, ref this._temp1,
                                         ref this._temp2);
                if (this._temp2.Count > 0)
                {
                    int index = foxFire.battle.random.Next(0, this._temp2.Count);
                    foxFire.Emmit(( Bio )this._temp2[index]);
                }
            }
            this._temp1.Clear();
            this._temp2.Clear();
        }
 // Start is called before the first frame update
 void Start()
 {
     parent = gameObject.GetComponentInParent <FoxFire>();
 }