public NStateBounced(NStateInfo info, EState state, float initialVelocity, int lockoutFrames) : base(info, state) { directionSwitchRatio = info.bd.bouncedDirectionSwitchRatio; maxLateralVelocity = info.bd.bouncedMaxLateralVelocity; initialVerticalVelocity = initialVelocity; _transitionLockoutFrames = lockoutFrames; }
void Start() { rigidBody = GetComponent <Rigidbody2D>(); boxCollider = GetComponent <BoxCollider2D>(); animator = GetComponent <Animator>(); spriteRenderer = GetComponent <SpriteRenderer>(); fireParticles = transform.GetChild(0).GetComponent <ParticleSystem>(); bloodParticles = transform.GetChild(1).GetComponent <ParticleSystem>(); joystick = ReInput.players.GetPlayer(playerNumber); movementBools = new Dictionary <string, bool>(); movementBools["pushed"] = false; movementBools["succed"] = false; movementBools["bounced"] = false; movementBools["frozen"] = false; movementBools["ashed"] = false; movementBools["spiked"] = false; movementBools["slipped"] = false; movementBools["doubled"] = false; movementBools["active"] = false; NStateInfo info = new NStateInfo(this, rigidBody, boxCollider, joystick, animator, spriteRenderer, balanceData); movementStates = new NState[13]; movementStates[0] = new NStateNormal(info, EState.normal); movementStates[1] = new NStateJump1(info, EState.jump1); movementStates[2] = new NStateJump2(info, EState.jump2); movementStates[3] = new NStateAshes(info, EState.ashes); movementStates[4] = new NStateAirborne(info, EState.airborne); movementStates[5] = new NStateSucc(info, EState.succ, transform.position); movementStates[6] = new NStatePushed(info, EState.pushed, Vector2.zero); movementStates[7] = new NStateBounced(info, EState.bounced, info.bd.bouncedInitialVelocity, info.bd.bouncedTransitionLockoutFrames); movementStates[8] = new NStateSpiked(info, EState.spiked, Vector2.zero); movementStates[9] = new NStateSlipped(info, EState.slipped); movementStates[10] = new NStateSlam(info, EState.slam); movementStates[11] = new NStateBounced(info, EState.boinked, info.bd.boinkedInitialVelocity, info.bd.boinkedTransitionLockoutFrames); movementStates[12] = new NStateInactive(info, EState.inactive); movementState = movementStates[12]; weapons = new SortedList <EElement, Queue <NWeapon> >(6); weapons[EElement.air] = new Queue <NWeapon>(weaponCounts[0]); weapons[EElement.fire] = new Queue <NWeapon>(weaponCounts[1]); weapons[EElement.water] = new Queue <NWeapon>(weaponCounts[2]); weapons[EElement.earth] = new Queue <NWeapon>(weaponCounts[3]); weapons[EElement.plasma] = new Queue <NWeapon>(weaponCounts[4]); weapons[EElement.none] = new Queue <NWeapon>(1); weaponEquipped = EElement.air; weapon = null; totem = null; totemDist = Mathf.Infinity; living = true; avatar = false; }
public NStateJump1(NStateInfo info, EState state) : base(info, state) { directionSwitchRatio = info.bd.jump1DirectionSwitchRatio; maxLateralVelocity = info.bd.jump1MaxLateralVelocity; initialVerticalVelocity = info.bd.jump1InitialVelocity; continuedHoldVelocity = info.bd.jump1ContinuedHoldVelocity; _continuedHoldFrames = info.bd.jump1ContinuedHoldFrames; _continuedHoldDelayFrames = info.bd.jump1ContinuedHoldDelayFrames; _shortHopFrames = info.bd.jump1ShortHopFrames; shortHopVelocity = info.bd.jump1ShortHopVelocity; regularHopVelocity = info.bd.jump1RegularHopVelocity; }
public NState(NStateInfo info, EState state) { this.state = state; player = info.p; rb = info.r; bc = info.b; bd = info.bd; ac = info.ac; sr = info.sr; joystick = info.j; freshJumpButton = false; heldJumpButton = false; globalGravityPerFrame = info.bd.globalGravityPerFrame; frozenSlideSpeed = info.bd.frozenSlideSpeed; frozenGravityPerFrame = info.bd.frozenGravityPerFrame; platformsLayer = LayerMask.NameToLayer("Platforms"); }
public NStateJump2(NStateInfo info, EState state) : base(info, state) { directionSwitchRatio = info.bd.jump2DirectionSwitchRatio; maxLateralVelocity = info.bd.jump2MaxLateralVelocity; initialVerticalVelocity = info.bd.jump2InitialVelocity; }
public NStateSucc(NStateInfo info, EState state, Vector3 blackHole) : base(info, state) { this.blackHole = blackHole; }
public NStateInactive(NStateInfo info, EState state) : base(info, state) { }
public NStatePushed(NStateInfo info, EState state, Vector2 pushDirection) : base(info, state) { this.pushDirection = pushDirection; _pushDuration = info.bd.pushedDuration; pushInitialVelocity = info.bd.pushedInitialVelocity; }
public NStateSpiked(NStateInfo info, EState state, Vector2 spikedDirection) : base(info, state) { this.spikedDirection = spikedDirection; }
public NStateSlipped(NStateInfo info, EState state) : base(info, state) { directionSwitchRatio = info.bd.slippedDirectionSwitchRatio; maxLateralVelocity = info.bd.slippedMaxLateralVelocity; }
public NStateNormal(NStateInfo info, EState state) : base(info, state) { directionSwitchRatio = info.bd.normalDirectionSwitchRatio; maxLateralVelocity = info.bd.normalMaxLateralVelocity; }
public NStateSlam(NStateInfo info, EState state) : base(info, state) { maxLateralVelocity = info.bd.slamMaxLateralVelocity; increasedGravityPerFrame = info.bd.slamIncreasedGravityPerFrame; _jumpLockoutFrames = info.bd.slamJumpLockoutFrames; }
public NStateAirborne(NStateInfo info, EState state) : base(info, state) { directionSwitchRatio = info.bd.airborneDirectionSwitchRatio; maxLateralVelocity = info.bd.airborneMaxLateralVelocity; }
public NStateAshes(NStateInfo info, EState state) : base(info, state) { gravityPerFrame = info.bd.ashGravityPerFrame; }