Exemple #1
0
        protected override void Update()
        {
            base.Update();
            if (this.charges > this.chargesMax)
            {
                this.charges = this.chargesMax;
            }
            this.gun.idleAnimation = this.gun.UpdateAnimation("idle" + ((this.charges > 0) ? this.charges.ToString() : ""), null, false);
            this.gun.PlayIdleAnimation();
            bool isFocusing = false;

            if (this.Player != null)
            {
                BraveInput input = BraveInput.GetInstanceForPlayer(this.Player.PlayerIDX);
                if (input != null && input.ActiveActions != null)
                {
                    InControl.PlayerAction action = input.ActiveActions.ReloadAction;
                    if (action.IsPressed)
                    {
                        if (this.charges >= 3)
                        {
                            reloadHoldTime += BraveTime.DeltaTime;
                            if (reloadHoldTime >= 1.5f)
                            {
                                reloadHoldTime = 0f;
                                this.Owner.healthHaver.ApplyHealing(0.5f);
                                this.Owner.PlayEffectOnActor(ResourceCache.Acquire("Global VFX/VFX_Healing_Sparkles_001") as GameObject, Vector3.zero, true, false, false);
                                AkSoundEngine.PostEvent("Play_OBJ_heart_heal_01", base.gameObject);
                                this.charges -= 3;
                                Toolbox.GetGunById(417).DefaultModule.projectiles[0].hitEffects.HandleEnemyImpact(this.gun.sprite.WorldCenter, 0f, this.gun.transform, Vector3.zero, Vector2.zero, false, false);
                            }
                            else if (reloadHoldTime >= 0.5f)
                            {
                                this.Owner.PlayEffectOnActor(SoulFocusVFX, new Vector3(0f, -0.5f, 0f), true, false, false);
                            }
                            if (reloadHoldTime >= 0.1f)
                            {
                                isFocusing = true;
                            }
                        }
                    }
                    if (!action.IsPressed && actionWasPressed)
                    {
                        if (reloadHoldTime <= 0.1f)
                        {
                            //Do stuff.
                        }
                        reloadHoldTime = 0f;
                    }
                    this.actionWasPressed = action.IsPressed;
                }
            }
            if (this.cooldownTimer > 0f)
            {
                this.cooldownTimer -= BraveTime.DeltaTime;
            }
            this.gun.RuntimeModuleData[this.gun.DefaultModule].onCooldown = this.cooldownTimer > 0 || isFocusing || charges < 3;
        }
Exemple #2
0
 void NewSuperDash()
 {
     InControl.PlayerAction cdash = GameManager.instance.inputHandler.inputActions.superDash;
     if (superDash.ActiveStateName != "Init")
     {
         superDash.SetState("Init");
     }
     if (cdash.WasPressed)
     {
         foreach (NamedVariable var in superDash.FsmVariables.GetAllNamedVariables())
         {
             Log($@"Superdash has variable {var.Name} ({var.GetType()}) = {var}");
         }
     }
 }