Beispiel #1
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.tracker = base.GetComponent <HenryTracker>();
            this.target  = this.tracker.GetTrackingTarget();

            if (base.characterBody)
            {
                base.characterBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage;
            }
            if (base.isGrounded)
            {
                base.SmallHop(base.characterMotor, 10f);
            }

            if (this.target && this.target.healthComponent && this.target.healthComponent.alive)
            {
                this.targetIsValid = true;
            }

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Punch");
            }

            this.attack                 = new OverlapAttack();
            this.attack.damageType      = DamageType.Generic;
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = DashPunch.damageCoefficient * this.damageStat;
            this.attack.procCoefficient = DashPunch.procCoefficient;
            this.attack.hitEffectPrefab = DashPunch.hitEffectPrefab;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
            this.attack.impactSound     = DashPunch.impactSound.index;
            this.attack.pushAwayForce   = DashPunch.pushForce * 0.2f;

            Util.PlaySound("HenryStinger", base.gameObject);
            base.PlayAnimation("FullBody, Override", "DashPunch");

            if (base.isGrounded)
            {
                EffectManager.SimpleEffect(Modules.Assets.dustEffect, base.characterBody.footPosition, base.transform.rotation, false);
            }
        }
Beispiel #2
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.tracker = base.GetComponent <HenryTracker>();

            if (!this.tracker.GetTrackingTarget())
            {
                this.activatorSkillSlot.AddOneStock();
                this.outer.SetNextStateToMain();
                return;
            }

            if (base.skillLocator.primary.skillDef.skillNameToken == HenryPlugin.developerPrefix + "_HENRY_BODY_PRIMARY_SLASH_NAME")
            {
                this.outer.SetNextState(new Stinger());
            }
            else
            {
                float desiredDist = 10f;
                if (!this.isGrounded)
                {
                    desiredDist = 7f;
                }

                float dist = Vector3.Distance(base.transform.position, this.tracker.GetTrackingTarget().transform.position);
                if (dist <= desiredDist)
                {
                    if (this.isGrounded)
                    {
                        this.outer.SetNextState(new Uppercut());
                        return;
                    }
                    else
                    {
                        this.outer.SetNextState(new AirSlam());
                        return;
                    }
                }
                else
                {
                    this.outer.SetNextState(new DashPunch());
                    return;
                }
            }
        }
Beispiel #3
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.tracker = base.GetComponent <HenryTracker>();

            if (!this.tracker.GetTrackingTarget())
            {
                this.activatorSkillSlot.AddOneStock();
                this.outer.SetNextStateToMain();
                return;
            }

            if (base.skillLocator.primary.skillDef.skillNameToken == HenryPlugin.developerPrefix + "_HENRY_BODY_PRIMARY_SLASH_NAME")
            {
                this.outer.SetNextState(new Stinger());
            }
            else
            {
                // i don't feel like coding the punch rn
                this.outer.SetNextState(new DashPunch());
            }
        }
Beispiel #4
0
 public override void OnEnter()
 {
     this.energyComponent = base.GetComponent <NemryEnergyComponent>();
     this.tracker         = base.GetComponent <HenryTracker>();
     base.OnEnter();
 }
        private static bool HasTarget([NotNull] GenericSkill skillSlot)
        {
            HenryTracker henryTracker = ((HenryTrackingSkillDef.InstanceData)skillSlot.skillInstanceData).henryTracker;

            return((henryTracker != null) ? henryTracker.GetTrackingTarget() : null);
        }