Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

Commit

Permalink
mannequin character for demo, small updates to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
WistfulHopes committed Aug 30, 2022
1 parent 7678212 commit f95b3ac
Show file tree
Hide file tree
Showing 64 changed files with 529 additions and 409 deletions.
Binary file modified Content/Blueprints/BP_FighterGameInstance.uasset
Binary file not shown.
Binary file modified Content/Blueprints/BP_FighterGameState.uasset
Binary file not shown.
Binary file modified Content/Blueprints/CharacterBP/Common/States/AirTech.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Content/Blueprints/CharacterBP/Mannequin/BP_Mannequin.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Content/Blueprints/CharacterBP/Mannequin/Manny_StateData.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/CharacterAssets/Common/Animations/BaseAnimBP.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Content/Manny_2A_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_5A_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_Air5A_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_airblock_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_airtech_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_backlaunch_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_backwalk_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_block_sequencer.uasset
Binary file not shown.
Binary file modified Content/Manny_crouch_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_crouchblock_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_crumple_sequencer.uasset
Binary file not shown.
Binary file modified Content/Manny_forwardwalk_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_hitstun_sequencer.uasset
Binary file not shown.
Binary file added Content/Manny_wakeup_sequence.uasset
Binary file not shown.
Binary file modified Content/Maps/Battle/TestMap.umap
Binary file not shown.
Binary file modified Content/UI/Battle/W_Battle.uasset
Binary file not shown.
Binary file modified Content/UI/CharaSelect/CharaSelectData.uasset
Binary file not shown.
Binary file modified Content/UI/CharaSelect/W_CSelectMain.uasset
Binary file not shown.
838 changes: 436 additions & 402 deletions Source/FighterEngine/Battle/Actors/BattleActor.cpp

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Source/FighterEngine/Battle/Actors/BattleActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class FIGHTERENGINE_API ABattleActor : public APawn
FHitEffect CounterHitEffect;
bool HitActive;
bool IsAttacking;
bool AttackHeadAttribute;
bool RoundStart = true;
bool HasHit;
bool DeactivateOnNextUpdate;
Expand Down Expand Up @@ -274,6 +275,8 @@ class FIGHTERENGINE_API ABattleActor : public APawn
UFUNCTION(BlueprintCallable)
void SetAttacking(bool Attacking); //sets attacking. while this is true, you can be counter hit, but you can also chain cancel
UFUNCTION(BlueprintCallable)
void SetHeadAttribute(bool HeadAttribute); //sets attacking. while this is true, you can be counter hit, but you can also chain cancel
UFUNCTION(BlueprintCallable)
void SetHitEffect(FHitEffect InHitEffect); //sets hit effect on normal hit
UFUNCTION(BlueprintCallable)
void SetCounterHitEffect(FHitEffect InHitEffect); //sets hit effect on counter hit
Expand Down
57 changes: 57 additions & 0 deletions Source/FighterEngine/Battle/Actors/FighterGameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ void AFighterGameState::HandleRoundWin()
BattleState.P1RoundsWon++;
Players[0]->RoundWinTimer--;
Players[0]->RoundWinInputLock = true;
BattleState.PauseTimer = true;
if (Players[0]->RoundWinTimer <= 0)
{
BattleState.PauseTimer = false;
HandleMatchWin();
RoundInit();
}
Expand All @@ -291,8 +293,10 @@ void AFighterGameState::HandleRoundWin()
BattleState.P2RoundsWon++;
Players[3]->RoundWinTimer--;
Players[3]->RoundWinInputLock = true;
BattleState.PauseTimer = true;
if (Players[3]->RoundWinTimer <= 0)
{
BattleState.PauseTimer = false;
HandleMatchWin();
RoundInit();
}
Expand All @@ -306,12 +310,62 @@ void AFighterGameState::HandleRoundWin()
}
Players[0]->RoundWinInputLock = true;
Players[0]->RoundWinTimer--;
BattleState.PauseTimer = true;
if (Players[0]->RoundWinTimer <= 0)
{
BattleState.PauseTimer = false;
HandleMatchWin();
RoundInit();
}
}
else if (BattleState.RoundTimer <= 0)
{
if (Players[0]->CurrentHealth > 0)
{
if (!Players[0]->RoundWinInputLock)
BattleState.P1RoundsWon++;
Players[0]->RoundWinTimer--;
Players[0]->RoundWinInputLock = true;
BattleState.PauseTimer = true;
if (Players[0]->RoundWinTimer <= 0)
{
BattleState.PauseTimer = false;
HandleMatchWin();
RoundInit();
}
}
else if (Players[3]->CurrentHealth > 0)
{
if (!Players[3]->RoundWinInputLock)
BattleState.P2RoundsWon++;
Players[3]->RoundWinTimer--;
Players[3]->RoundWinInputLock = true;
BattleState.PauseTimer = true;
if (Players[3]->RoundWinTimer <= 0)
{
BattleState.PauseTimer = false;
HandleMatchWin();
RoundInit();
}
}
else if (Players[0]->CurrentHealth == Players[3]->CurrentHealth)
{
if (!Players[0]->RoundWinInputLock)
{
BattleState.P1RoundsWon++;
BattleState.P2RoundsWon++;
}
Players[0]->RoundWinInputLock = true;
Players[0]->RoundWinTimer--;
BattleState.PauseTimer = true;
if (Players[0]->RoundWinTimer <= 0)
{
BattleState.PauseTimer = false;
HandleMatchWin();
RoundInit();
}
}
}
}
}

Expand Down Expand Up @@ -755,6 +809,9 @@ void AFighterGameState::UpdateUI()
BattleUIActor->Widget->P2Health[1] = float(Players[4]->CurrentHealth) / float(Players[4]->Health);
BattleUIActor->Widget->P2Health[2] = float(Players[5]->CurrentHealth) / float(Players[5]->Health);
}
BattleUIActor->Widget->P1RoundsWon = BattleState.P1RoundsWon;
BattleUIActor->Widget->P2RoundsWon = BattleState.P2RoundsWon;
BattleUIActor->Widget->Timer = ceil((float)BattleState.RoundTimer / 60);
}
}
}
Expand Down
32 changes: 25 additions & 7 deletions Source/FighterEngine/Battle/Actors/PlayerCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ void APlayerCharacter::Update()
if (Untech == 0 && PosY > 0 && !IsDead)
EnableState(ENB_Tech);

if (StateMachine.CurrentState->StateType == EStateType::Tech)
HasBeenOTG = 0;

if (StateMachine.CurrentState->StateType == EStateType::Hitstun && PosY <= 0 && PrevPosY > 0)
{
if (StateMachine.CurrentState->Name == "BLaunch")
Expand All @@ -168,6 +171,8 @@ void APlayerCharacter::Update()

if (KnockdownTime == 0 && PosY <= 0 && !IsDead)
{
Enemy->ComboCounter = 0;
HasBeenOTG = 0;
ClearInertia();
if (StateMachine.CurrentState->Name == "FaceDown" || StateMachine.CurrentState->Name == "FaceDownBounce")
JumpToState("WakeUpFaceDown");
Expand Down Expand Up @@ -624,18 +629,22 @@ bool APlayerCharacter::IsCorrectBlock(EBlockType BlockType)
{
return true;
}
if ((CheckInput(EInputCondition::Input_Left_Hold) || CheckInput(EInputCondition::Input_Left_Press)))
{
return true;
}
}
return false;
}

void APlayerCharacter::HandleBlockAction()
{
EnableInertia();
if (CheckInputRaw(InputLeft) && !CheckInputRaw(InputDown))
if (CheckInputRaw(InputLeft) && !CheckInputRaw(InputDown) && PosY <= 0)
{
JumpToState("Block");
}
else if (CheckInputRaw(InputDownLeft))
else if (CheckInputRaw(InputDownLeft) && PosY <= 0)
{
JumpToState("CrouchBlock");
}
Expand Down Expand Up @@ -691,6 +700,11 @@ void APlayerCharacter::SetThrowInvulnerable(bool Invulnerable)
ThrowInvulnerable = Invulnerable;
}

void APlayerCharacter::SetHeadInvulnerable(bool Invulnerable)
{
HeadInvulnerable = Invulnerable;
}

void APlayerCharacter::SetThrowActive(bool Active)
{
ThrowActive = Active;
Expand Down Expand Up @@ -865,6 +879,7 @@ void APlayerCharacter::OnStateChange()
WhiffCancelOptions.Empty();
StateName.SetString("");
HitEffectName.SetString("");
Gravity = JumpGravity;
for (int i = 0; i < CancelArraySize; i++)
{
ChainCancelOptionsInternal[i] = -1;
Expand All @@ -886,6 +901,8 @@ void APlayerCharacter::OnStateChange()
ThrowActive = false;
StrikeInvulnerable = false;
ThrowInvulnerable = false;
HeadInvulnerable = false;
AttackHeadAttribute = false;
PushWidthExpand = 0;
}

Expand Down Expand Up @@ -1039,13 +1056,14 @@ void APlayerCharacter::ResetForRound()
Untech = -1;
TotalProration = 10000;
ComboCounter = 0;
HasBeenOTG = 0;
TouchingWall = false;
ChainCancelEnabled = true;
WhiffCancelEnabled = true;
StrikeInvulnerable = true;
WhiffCancelEnabled = true;
StrikeInvulnerable = true;
ThrowInvulnerable = true;
WhiffCancelEnabled = false;
StrikeInvulnerable = false;
WhiffCancelEnabled = false;
StrikeInvulnerable = false;
ThrowInvulnerable = false;
RoundWinTimer = 300;
RoundWinInputLock = false;
for (int i = 0; i < CancelArraySize; i++)
Expand Down
4 changes: 4 additions & 0 deletions Source/FighterEngine/Battle/Actors/PlayerCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ class FIGHTERENGINE_API APlayerCharacter : public ABattleActor
int32 KnockdownTime = -1;
int32 TotalProration = 10000;
int32 ComboCounter = 0;
int HasBeenOTG;
bool TouchingWall;
bool ChainCancelEnabled = true;
bool WhiffCancelEnabled;
bool StrikeInvulnerable;
bool ThrowInvulnerable;
bool HeadInvulnerable;
int RoundWinTimer = 300;
bool RoundWinInputLock;

Expand Down Expand Up @@ -288,6 +290,8 @@ class FIGHTERENGINE_API APlayerCharacter : public ABattleActor
UFUNCTION(BlueprintCallable)
void SetThrowInvulnerable(bool Invulnerable); //sets throw invulnerable enabled
UFUNCTION(BlueprintCallable)
void SetHeadInvulnerable(bool Invulnerable); //sets throw invulnerable enabled
UFUNCTION(BlueprintCallable)
void SetThrowActive(bool Active); //initiate throw
UFUNCTION(BlueprintCallable)
void ThrowEnd(); //end throw
Expand Down
4 changes: 4 additions & 0 deletions Source/FighterEngine/Miscellaneous/FighterBattleWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ class FIGHTERENGINE_API UFighterBattleWidget : public UUserWidget
float P1Gauge2;
UPROPERTY(BlueprintReadOnly)
float P2Gauge2;
UPROPERTY(BlueprintReadOnly)
int P1RoundsWon;
UPROPERTY(BlueprintReadOnly)
int P2RoundsWon;
};

0 comments on commit f95b3ac

Please sign in to comment.