private static SubKnockdownOptions UpgradeKnockdownOptions(SubKnockdownOptions knockDown) { knockDown._knockedOutTime = knockDown.knockedOutTime; knockDown._standUpTime = knockDown.standUpTime; knockDown._predefinedPushForce = FPVector.ToFPVector(knockDown.predefinedPushForce); return(knockDown); }
public void UpdateMap(int frame) { if (controlsScript == null) { return; } if (animationMaps == null && controlsScript.myInfo.useAnimationMaps) { Debug.LogError("Animation '" + moveSetScript.GetCurrentClipName() + "' has no animation maps"); return; } if (controlsScript.myInfo.useAnimationMaps) { HitBoxMap[] hitBoxMaps = new HitBoxMap[0]; int highestFrame = 0; foreach (AnimationMap map in animationMaps) { if (map.frame > highestFrame) { highestFrame = map.frame; } if (map.frame == frame) { hitBoxMaps = map.hitBoxMaps; deltaPosition = map.deltaDisplacement; break; } } // If frame can't be found, cast the highest possible frame if (hitBoxMaps.Length == 0) { hitBoxMaps = animationMaps[highestFrame].hitBoxMaps; deltaPosition = animationMaps[highestFrame].deltaDisplacement; } foreach (HitBoxMap map in hitBoxMaps) { foreach (HitBox hitBox in hitBoxes) { if (hitBox.bodyPart == map.bodyPart) { hitBox.mappedPosition = map.mappedPosition; if (currentMirror) { hitBox.mappedPosition.x += (hitBox.mappedPosition.x * -2); } } } } } else { foreach (HitBox hitBox in hitBoxes) { hitBox.mappedPosition = FPVector.ToFPVector(hitBox.position.position) - worldTransform.position; } } }
public FPVector GetDeltaPosition() { if (controlsScript.myInfo.useAnimationMaps) { return(deltaPosition * -controlsScript.mirror); } else { return(FPVector.ToFPVector(moveSetScript.GetDeltaPosition())); } }
public HitBoxMap[] GetAnimationMaps() { List <HitBoxMap> animMaps = new List <HitBoxMap>(); foreach (HitBox hitBox in hitBoxes) { HitBoxMap animMap = new HitBoxMap(); animMap.bodyPart = hitBox.bodyPart; animMap.mappedPosition = FPVector.ToFPVector(hitBox.position.position); animMaps.Add(animMap); } return(animMaps.ToArray()); }
public void Override(FluxSimpleState state) { this.player1.life = state.p1.life; this.player1.gauge = state.p1.gauge; this.player1.shellTransform.position = state.p1.position; this.player1.shellTransform.fpPosition = FPVector.ToFPVector(state.p1.position); this.player2.life = state.p2.life; this.player2.gauge = state.p2.gauge; this.player2.shellTransform.position = state.p2.position; this.player2.shellTransform.fpPosition = FPVector.ToFPVector(state.p2.position); this.networkFrame = state.frame; }
public FPVector GetPosition(BodyPart bodyPart) { foreach (HitBox hitBox in hitBoxes) { if (bodyPart == hitBox.bodyPart) { FPVector newMap = new FPVector(); if (controlsScript == null) { // If its running from the editor, load positions from transforms newMap = FPVector.ToFPVector(hitBox.position.position); } else { newMap = hitBox.mappedPosition + worldTransform.position; } return(newMap); } } return(FPVector.zero); }
private static void SpecialMoveUpdate(MoveInfo move) { if (move == null) { return; } move.version = 2f; move._gaugeDPS = move.gaugeDPS; move._totalDrain = move.totalDrain; move._gaugeRequired = move.gaugeRequired; move._gaugeUsage = move.gaugeUsage; move._gaugeGainOnMiss = move.gaugeGainOnMiss; move._gaugeGainOnHit = move.gaugeGainOnHit; move._gaugeGainOnBlock = move.gaugeGainOnBlock; move._opGaugeGainOnBlock = move.opGaugeGainOnBlock; move._opGaugeGainOnParry = move.opGaugeGainOnParry; move._opGaugeGainOnHit = move.opGaugeGainOnHit; move._blendingIn = move.blendingIn; move._blendingOut = move.blendingOut; move._chargeTiming = move.chargeTiming; move.blockableArea._radius = move.blockableArea.radius; move.blockableArea._offSet = FPVector.ToFPVector(move.blockableArea.offSet); move._animationSpeed = move.animationSpeed; if (move.animationClip == null) { Debug.LogWarning("Move " + move.name + " has no animation attached."); } else { move.animMap.clip = move.animationClip; move.animMap.length = move.animationClip.length; } foreach (Projectile projectile in move.projectiles) { projectile._damageOnHit = projectile.damageOnHit; projectile._damageOnBlock = projectile.damageOnBlock; projectile._castingOffSet = FPVector.ToFPVector(projectile.castingOffSet); projectile._pushForce = FPVector.ToFPVector(projectile.pushForce); projectile.hurtBox._radius = projectile.hurtBox.radius; projectile.hurtBox._offSet = FPVector.ToFPVector(projectile.hurtBox.offSet); projectile.hurtBox._rect = new FPRect(projectile.hurtBox.rect); } foreach (AppliedForce aForce in move.appliedForces) { aForce._force = FPVector.ToFPVector(aForce.force); } foreach (Hit hit in move.hits) { hit._newHitBlendingIn = hit.newHitBlendingIn; hit._newJuggleWeight = hit.newJuggleWeight; hit._hitStunOnHit = hit.hitStunOnHit; hit._hitStunOnBlock = hit.hitStunOnBlock; hit._damageOnHit = hit.damageOnHit; hit._damageOnBlock = hit.damageOnBlock; hit._newMovementSpeed = hit.newMovementSpeed; hit._newRotationSpeed = hit.newRotationSpeed; hit._cameraSpeedDuration = hit.cameraSpeedDuration; hit._pushForce = FPVector.ToFPVector(hit.pushForce); hit._pushForceAir = FPVector.ToFPVector(hit.pushForceAir); hit._appliedForce = FPVector.ToFPVector(hit.appliedForce); hit._groundBouncePushForce = FPVector.ToFPVector(hit.groundBouncePushForce); hit._wallBouncePushForce = FPVector.ToFPVector(hit.wallBouncePushForce); foreach (HurtBox hurtBox in hit.hurtBoxes) { hurtBox._radius = hurtBox.radius; hurtBox._offSet = FPVector.ToFPVector(hurtBox.offSet); hurtBox._rect = new FPRect(hurtBox.rect); } hit.pullEnemyIn._targetDistance = hit.pullEnemyIn.targetDistance; hit.pullSelfIn._targetDistance = hit.pullSelfIn.targetDistance; if (hit.overrideHitEffects) { hit.hitEffects = UpgradeHitOptions(hit.hitEffects); } } foreach (SlowMoEffect slowMo in move.slowMoEffects) { slowMo._duration = slowMo.duration; slowMo._percentage = slowMo.percentage; } foreach (CameraMovement camMove in move.cameraMovements) { camMove._duration = camMove.duration; camMove._myAnimationSpeed = camMove.myAnimationSpeed; camMove._opAnimationSpeed = camMove.opAnimationSpeed; } foreach (OpponentOverride opOvr in move.opponentOverride) { opOvr._stunTime = opOvr.stunTime; opOvr._position = FPVector.ToFPVector(opOvr.position); } foreach (AnimSpeedKeyFrame animKey in move.animSpeedKeyFrame) { animKey._speed = animKey.speed; } EditorUtility.SetDirty(move); Debug.Log("Move " + move.name + " updated."); }