Skip to content

Commit

Permalink
Merge branch 'Albeoris:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SamsamTS authored Jun 9, 2024
2 parents 9279612 + 532119d commit a31da78
Show file tree
Hide file tree
Showing 299 changed files with 6,483 additions and 3,556 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false

# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
dotnet_style_predefined_type_for_locals_parameters_members = false # Int32 value = 1;
dotnet_style_predefined_type_for_member_access = false # Int32.Parse

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# Данный GITIGNORE-файл был автоматически создан Microsoft(R) Visual Studio.
################################################################################

.idea/
.vs/
bin/
obj/
/packages/
/Output/
/.idea/
/.vs/
/ipch/
/References
*.suo
*.user
*.DotSettings*
Expand All @@ -19,5 +20,4 @@ obj/
*.sdf
*.tlog
*.meta
/References
*.log
31 changes: 22 additions & 9 deletions Assembly-CSharp/Assembly-CSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<UsingTask AssemblyFile="$(SolutionDir)\References\Memoria.MSBuild.dll" TaskName="Memoria.MSBuild.Deploy" />
<PropertyGroup>
Expand All @@ -15,7 +15,6 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FrameworkPathOverride>$(SolutionDir)\References\</FrameworkPathOverride>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -28,7 +27,6 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>CS0414;CS0649;CS0169;CS0108;CS0618</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -39,12 +37,15 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\References\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization">
<Private>True</Private>
<!-- Don't remove, for Newtonsoft.Json -->
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\References\UnityEngine.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -341,9 +342,21 @@
<Compile Include="Memoria\Assets\FieldCreator\FieldCreatorScene.cs" />
<Compile Include="Memoria\Assets\FieldCreator\PointScreenAnchor.cs" />
<Compile Include="Memoria\Assets\FieldCreator\WavefrontObject.cs" />
<Compile Include="Memoria\Assets\Text\Strings\ITextReader.cs" />
<Compile Include="Memoria\Assets\Text\Strings\ITextWriter.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TextFormatterHelper.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TextResourceFormat.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TextResourceFormatHelper.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TextResourcePath.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TextResourceReference.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TextResjsonFormatter.cs" />
<Compile Include="Memoria\Battle\Calculator\EatResult.cs" />
<Compile Include="Memoria\Configuration\Access\Interface.cs" />
<Compile Include="Memoria\Configuration\Structure\InterfaceSection.cs" />
<Compile Include="Memoria\Data\Battle\BattleCommandMenu.cs" />
<Compile Include="Memoria\Data\Battle\BattleMagicSwordSet.cs" />
<Compile Include="Memoria\Data\ff9mixitem.cs" />
<Compile Include="Memoria\Data\Items\MixItems.cs" />
<Compile Include="Memoria\Data\TetraMaster\TripleTriad.cs" />
<Compile Include="Memoria\Data\TetraMaster\TripleTriadCard.cs" />
<Compile Include="Memoria\Data\TetraMaster\TetraMasterCardId.cs" />
Expand Down Expand Up @@ -1215,11 +1228,9 @@
<Compile Include="Memoria\Assets\Text\ModTextResources.cs" />
<Compile Include="Memoria\Assets\Text\ResourceExporter.cs" />
<Compile Include="Memoria\Assets\Text\ResourceImporter.cs" />
<Compile Include="Memoria\Assets\Text\Strings\ITxtFormatter.cs" />
<Compile Include="Memoria\Assets\Text\Strings\StringsFormatter.cs" />
<Compile Include="Memoria\Assets\Text\Strings\ITextFormatter.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TextStringsFormatter.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TxtEntry.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TxtReader.cs" />
<Compile Include="Memoria\Assets\Text\Strings\TxtWriter.cs" />
<Compile Include="Memoria\Assets\Text\TextureHelper.cs" />
<Compile Include="Memoria\Battle\Calculator\BattleCalcFlags.cs" />
<Compile Include="Memoria\Battle\Calculator\BattleCalculator.cs" />
Expand Down Expand Up @@ -1376,7 +1387,6 @@
<EmbeddedResource Include="Memoria\Configuration\Memoria.ini" />
<None Include="NCalc\Grammar\NCalc.g" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Global\Sound\SoLoud\x64\soloud.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -1385,6 +1395,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Deploy SolutionDir="$(SolutionDir)" TargetPath="$(TargetPath)" TargetDir="$(TargetDir)" TargetName="$(TargetName)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class FF9TextTool : PersistenSingleton<FF9TextTool>
public static Color Cyan => new Color(0.407843143f, 0.7529412f, 0.847058833f);
public static Color Red => new Color(0.8156863f, 0.3764706f, 0.3137255f);
public static Color Yellow => new Color(0.784313738f, 0.6901961f, 0.2509804f);
public static Color DarkYellow => new Color(0.588f, 0.584f, 0.267f);
public static Color Magenta => new Color(0.721568644f, 0.5019608f, 0.8784314f);

public static Int32 FieldZoneId => fieldZoneId;
Expand Down Expand Up @@ -708,4 +709,4 @@ private static void ProcessEntryId(ref String entry, ref Int32 id)
}
}
}
}
}
4 changes: 3 additions & 1 deletion Assembly-CSharp/FF9/Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public class Param

public const Byte FIG_STAT_INFO_REGENE_DMG = 8;

public const Byte WPN_CATEGORY_SHORT_RANGE = 1;
public const Byte FIG_STAT_INFO_REGENE_MP = 16;

public const Byte WPN_CATEGORY_SHORT_RANGE = 1;

public const Byte WPN_CATEGORY_LONG_RANGE = 2;

Expand Down
79 changes: 18 additions & 61 deletions Assembly-CSharp/FF9/btl_mot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,65 +203,22 @@ public static Boolean IsLoopingMotion(BattlePlayerCharacter.PlayerMotionIndex in

public static void PlayAnim(BTL_DATA btl)
{
btl._smoothUpdatePlayingAnim = false;
if (btl.currentAnimationName == null)
if (btl.currentAnimationName == null || btl.bi.stop_anim != 0)
return;
GameObject gameObject = btl.gameObject;
String currentAnimationName = btl.currentAnimationName;
UInt16 animMaxFrame = GeoAnim.geoAnimGetNumFrames(btl, currentAnimationName);
Boolean reverseSpeed = btl.animSpeed < 0f;
Single animFrame = btl.evt.animFrame; // + (reverseSpeed ? -btl.animFrameFrac : btl.animFrameFrac);
if (!gameObject.GetComponent<Animation>().IsPlaying(currentAnimationName))
{
if (gameObject.GetComponent<Animation>().GetClip(currentAnimationName) == null)

Animation anim = btl.gameObject.GetComponent<Animation>();
String animName = btl.currentAnimationName;
Int32 animMaxFrame = GeoAnim.geoAnimGetNumFrames(btl, animName);
if (!anim.IsPlaying(animName))
{
if (anim.GetClip(animName) == null)
return;
gameObject.GetComponent<Animation>().Play(currentAnimationName);
}
AnimationState clipState = gameObject.GetComponent<Animation>()[currentAnimationName];
Single time = animMaxFrame == 0 ? 0f : Mathf.Clamp(animFrame / animMaxFrame * clipState.length, 0f, clipState.length);
Int32 animLoopFrame = GeoAnim.getAnimationLoopFrame(btl);
clipState.speed = 0f;
btl._smoothUpdatePlayingAnim = true;
btl._smoothUpdateAnimTimePrevious = clipState.time;
if (animMaxFrame != 0 && btl.bi.disappear == 0 && !btl_mot.IsAnimationFrozen(btl))
{
if (btl.evt.animFrame == 0 && !reverseSpeed)
btl._smoothUpdateAnimTimePrevious = time - btl.animSpeed / animMaxFrame * clipState.length;
else if (btl.evt.animFrame == animLoopFrame && reverseSpeed)
btl._smoothUpdateAnimTimePrevious = time + btl.animSpeed / animMaxFrame * clipState.length;
}
btl._smoothUpdateAnimTimeActual = time;
clipState.time = time;
gameObject.GetComponent<Animation>().Sample();
if (btl.evt.animFrame == animLoopFrame && !reverseSpeed)
{
// Try to smoothen standard animation chains
if (btl_mot.checkMotion(btl, BattlePlayerCharacter.PlayerMotionIndex.MP_RUN))
{
gameObject.GetComponent<Animation>().CrossFade(btl.mot[(Int32)BattlePlayerCharacter.PlayerMotionIndex.MP_RUN_TO_ATTACK], 1f / FPSManager.GetMainLoopSpeed());
btl._smoothUpdatePlayingAnim = false;
}
else if (btl_mot.checkMotion(btl, BattlePlayerCharacter.PlayerMotionIndex.MP_RUN_TO_ATTACK))
{
gameObject.GetComponent<Animation>().CrossFade(btl.mot[(Int32)BattlePlayerCharacter.PlayerMotionIndex.MP_ATTACK], 1f / FPSManager.GetMainLoopSpeed());
btl._smoothUpdatePlayingAnim = false;
}
else if (btl_mot.checkMotion(btl, BattlePlayerCharacter.PlayerMotionIndex.MP_ATTACK))
{
gameObject.GetComponent<Animation>().CrossFade(btl.mot[(Int32)BattlePlayerCharacter.PlayerMotionIndex.MP_BACK], 1f / FPSManager.GetMainLoopSpeed());
btl._smoothUpdatePlayingAnim = false;
}
else if (btl_mot.checkMotion(btl, BattlePlayerCharacter.PlayerMotionIndex.MP_BACK))
{
gameObject.GetComponent<Animation>().CrossFade(btl.mot[(Int32)BattlePlayerCharacter.PlayerMotionIndex.MP_ATK_TO_NORMAL], 1f / FPSManager.GetMainLoopSpeed());
btl._smoothUpdatePlayingAnim = false;
}
else if (btl_mot.checkMotion(btl, BattlePlayerCharacter.PlayerMotionIndex.MP_ATK_TO_NORMAL))
{
gameObject.GetComponent<Animation>().CrossFade(btl.mot[(Int32)BattlePlayerCharacter.PlayerMotionIndex.MP_IDLE_NORMAL], 1f / FPSManager.GetMainLoopSpeed());
btl._smoothUpdatePlayingAnim = false;
}
anim.Play(animName);
}
AnimationState animState = anim[animName];
animState.speed = 0f;
animState.time = (Single)btl.evt.animFrame / animMaxFrame * animState.length;
anim.Sample();
}

public static Int32 GetDirection(BTL_DATA btl)
Expand Down Expand Up @@ -547,7 +504,7 @@ public static void SetDefaultIdle(BTL_DATA btl, Boolean isEndOfAnim = false)
BattlePlayerCharacter.PlayerMotionIndex currentAnim = btl_mot.getMotion(btl);
if (btl_stat.CheckStatus(btl, BattleStatusConst.Immobilized))
{
if (btl.bi.player != 0 && !btl.is_monster_transform && btl_stat.CheckStatus(btl, BattleStatus.Venom & BattleStatusConst.IdleDying))
if (btl.bi.player != 0 && !btl.is_monster_transform && btl_stat.CheckStatus(btl, BattleStatusConst.Immobilized & BattleStatusConst.IdleDying))
{
btl_mot.setMotion(btl, BattlePlayerCharacter.PlayerMotionIndex.MP_IDLE_DYING);
btl.evt.animFrame = 0;
Expand Down Expand Up @@ -599,15 +556,15 @@ public static void SetDefaultIdle(BTL_DATA btl, Boolean isEndOfAnim = false)
targetAnim = BattlePlayerCharacter.PlayerMotionIndex.MP_ESCAPE;
else if (btl.bi.cmd_idle == 1)
targetAnim = BattlePlayerCharacter.PlayerMotionIndex.MP_IDLE_CMD;
if (currentAnim == targetAnim)
if (currentAnim == targetAnim)
{
if (isEndOfAnim)
btl.evt.animFrame = 0;
return;
}
BattlePlayerCharacter.PlayerMotionStance previousStance = btl_mot.EndingMotionStance(currentAnim);
BattlePlayerCharacter.PlayerMotionStance previousStance = btl_mot.EndingMotionStance(currentAnim);
BattlePlayerCharacter.PlayerMotionStance nextStance = btl_mot.StartingMotionStance(targetAnim);
if (previousStance == BattlePlayerCharacter.PlayerMotionStance.SPECIAL_ANY_IDLE)
if (previousStance == BattlePlayerCharacter.PlayerMotionStance.SPECIAL_ANY_IDLE)
{
if (nextStance == BattlePlayerCharacter.PlayerMotionStance.NORMAL || nextStance == BattlePlayerCharacter.PlayerMotionStance.CMD || nextStance == BattlePlayerCharacter.PlayerMotionStance.DYING || nextStance == BattlePlayerCharacter.PlayerMotionStance.DEFEND)
{
Expand Down Expand Up @@ -910,4 +867,4 @@ public static void SetPlayerDefMotion(BTL_DATA btl, CharacterSerialNumber serial
btl.animEndFrame = false;
}
}
}
}
10 changes: 3 additions & 7 deletions Assembly-CSharp/FF9/btl_sys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,8 @@ public static void CheckBattlePhase(BTL_DATA btl)
{
BattleUnit unit = new BattleUnit(next);
Character player = unit.Player;
if (player.Equipment.Accessory == RegularItem.PhoenixDown && ff9item.FF9Item_GetCount(RegularItem.PhoenixDown) > 9 && ff9item.FF9Item_GetCount(RegularItem.PhoenixDown) > (Comn.random16() % 100))
{
ff9item.FF9Item_Remove(RegularItem.PhoenixDown, 99);
ff9item.FF9Item_Add(RegularItem.PhoenixDown, Comn.random16() % 10);
if (player.Equipment.Accessory == RegularItem.PhoenixPinion && ff9item.FF9Item_GetCount(RegularItem.PhoenixPinion) > Comn.random8())
procRebirthFlame = true;
}
}
else
{
Expand Down Expand Up @@ -319,9 +315,9 @@ public static void CheckEscape(Boolean calc_check)
}
else
{
if (calc_check && UIManager.Battle.FF9BMenu_IsEnableAtb())
if (calc_check && UIManager.Battle.IsNativeEnableAtb())
SBattleCalculator.CalcMain(null, null, null, fleeScriptId);
}
}
}
}
}
44 changes: 24 additions & 20 deletions Assembly-CSharp/FF9/btl_util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public static Boolean IsCommandDeclarable(BattleCommandId cmdNo)

public static BattleAbilityId GetCommandMainActionIndex(CMD_DATA cmd)
{
if (cmd.regist != null && cmd.regist.bi.player == 0)
if (cmd.regist != null && cmd.regist.bi.player == 0)
return BattleAbilityId.Void;
if (IsCommandMonsterTransform(cmd))
return BattleAbilityId.Void;
Expand All @@ -307,24 +307,26 @@ public static BattleAbilityId GetCommandMainActionIndex(CMD_DATA cmd)
}
}

public static RegularItem GetCommandItem(CMD_DATA cmd)
{
if (cmd.regist != null && cmd.regist.bi.player == 0)
return RegularItem.NoItem;
if (IsCommandMonsterTransform(cmd) || IsCommandMonsterTransformAttack(cmd))
return RegularItem.NoItem;
switch (cmd.cmd_no)
{
case BattleCommandId.Throw:
case BattleCommandId.Item:
case BattleCommandId.AutoPotion:
return (RegularItem)cmd.sub_no;
default:
return RegularItem.NoItem;
}
}

public static AA_DATA GetCommandMonsterAttack(CMD_DATA cmd)
public static RegularItem GetCommandItem(CMD_DATA cmd)
{
if (cmd.regist != null && cmd.regist.bi.player == 0)
return RegularItem.NoItem;
if (IsCommandMonsterTransform(cmd) || IsCommandMonsterTransformAttack(cmd))
return RegularItem.NoItem;
if (BattleHUD.MixCommandSet.Contains(cmd.cmd_no))
return ff9mixitem.MixItemsData[cmd.sub_no].Result;
switch (cmd.cmd_no)
{
case BattleCommandId.Throw:
case BattleCommandId.Item:
case BattleCommandId.AutoPotion:
return (RegularItem)cmd.sub_no;
default:
return RegularItem.NoItem;
}
}

public static AA_DATA GetCommandMonsterAttack(CMD_DATA cmd)
{
if (IsCommandMonsterTransform(cmd))
return cmd.regist.monster_transform.spell[cmd.sub_no];
Expand All @@ -347,7 +349,9 @@ public static AA_DATA GetCommandAction(CMD_DATA cmd)

public static Int32 GetCommandScriptId(CMD_DATA cmd)
{
switch (cmd.cmd_no)
if (BattleHUD.MixCommandSet.Contains(cmd.cmd_no))
return ff9item.GetItemEffect(btl_util.GetCommandItem(cmd)).Ref.ScriptId;
switch (cmd.cmd_no)
{
case BattleCommandId.Jump:
case BattleCommandId.Jump2:
Expand Down
Loading

0 comments on commit a31da78

Please sign in to comment.