Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Jul 24, 2023
2 parents 313a187 + d8fe18a commit 3ed5ef9
Show file tree
Hide file tree
Showing 21 changed files with 644 additions and 39 deletions.
29 changes: 28 additions & 1 deletion DragaliaAPI.Shared.Test/Unit/MasterAssetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,13 @@ public void AbilityCrest_Get_ReturnsExpectedProperties()
UniqueBuildupMaterialId: Materials.GeniusoftheCenturysMemory,
DuplicateEntityId: Materials.GeniusoftheCenturysMemory,
DuplicateEntityQuantity: 6,
DuplicateEntityType: EntityTypes.Material
DuplicateEntityType: EntityTypes.Material,
Abilities11: 2338,
Abilities12: 2339,
Abilities13: 2340,
Abilities21: 0,
Abilities22: 0,
Abilities23: 0
)
);
}
Expand Down Expand Up @@ -730,4 +736,25 @@ public void AbilityCrest_DuplicateMaterialMap_ReturnsExpectedDictionary()
new Dictionary<Materials, int>() { { Materials.GeniusoftheCenturysMemory, 6 } }
);
}

[Fact]
public void AbilityCrest_GetAbilities_ReturnsExpected()
{
AbilityCrest crest = MasterAsset.MasterAsset.AbilityCrest[AbilityCrests.TotheExtreme];

crest
.GetAbilities(1)
.Should()
.BeEquivalentTo(new List<int>() { crest.Abilities11, crest.Abilities21 });

crest
.GetAbilities(2)
.Should()
.BeEquivalentTo(new List<int>() { crest.Abilities12, crest.Abilities22 });

crest
.GetAbilities(3)
.Should()
.BeEquivalentTo(new List<int>() { crest.Abilities13, crest.Abilities23 });
}
}
116 changes: 116 additions & 0 deletions DragaliaAPI.Shared/Definitions/Enums/AbilityTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
namespace DragaliaAPI.Shared.Definitions.Enums;

public enum AbilityTypes
{
None,
StatusUp,
ResistAbs,
ActAddAbs,
ResistTribe,
ActKillerTribe,
ActDamageUp,
ActCriticalUp,
ActRecoveryUp,
ActBreakUp,
ResistTrap,
AddRecoverySp,
AddRecoveryDp,
RecoveryHpOnHitCount,
ChangeState,
ResistInstantDeath,
DebuffGrantUp,
SpCharge,
BuffExtension,
DebuffExtension,
AbnormalKiller,
UserExpUp,
CharaExpUp,
CoinUp,
ManaUp,
ActionGrant,
CriticalDamageUp,
DpCharge,
ResistElement,
ResistUnique,
UniqueKiller,
Dummy01,
Dummy02,
BuildEventBoost, // Originally Dummy03
Dummy04,
ModeGaugeSuppression,
DragonDamageUp,
EnemyAbilityKiller,
HitAttribute,
PassiveGrant,
ActiveGaugeStatusUp,
Dummy05,
HitAttributeShift,
ReferenceOther,
EnhancedSkill,
EnhancedBurstAttack,
DragonTimeForParty,
AbnoramlExtension,
DragonTimeSpeedRate,
DpChargeMyParty,
DontAct,
RandomBuff,
CriticalUpDependsOnBuffTypeCount,
InvalidDragonAbility,
ActDamageUpDependsOnHitCount,
ChainTimeExtension,
UniqueTransform,
EnhancedElementDamage,
UtpCharge,
DebuffTimeExtensionForSpecificDebuffs,
RemoveAllStockBullets,
ChangeMode,
RandomBuffNoTDuplicate_Param1Times,
ModifyBuffDebuffDurationTime,
CpCoef,
UniqueAvoid,
RebornHpRateUp,
AttackBaseOnHPUpRate,
ChangeStateHostile,
CpContinuationDown,
AddCpRate,
RunOptionAction,
SecondElements,
KickAuraEffectTritter,
ConsumeSpToRecoverHp,
CrestGroupScoreUp,
ModifyBuffDebuffDurationTimeByRecoveryHp,
CrisisRate,
ActDamageDown,
AutoAvoidProbability,
LimitCriticalAddRate,
AddReborn,
RunOptionActionRemoteToo,
ConsumeUtpToRecoverHp,
DpGaugeCap,
AbnormalTypeNumKiller,
RegisterKeepComboAction,
NotUpdateDragonTime,
SetCharacterState,
ChangeModeRemoteToo,
RecoverySpCutRate,
ActRecoveryMulForDyingTarget,
CallCpCommand,
AdditionalHitCollision,
RecoveryOnDamage,
Guts,
SendSignal,
RemoveSignal,
StatusUpBaseOnCharaType,
ChangeStateOtherPartyMembers,
DpGaugeCap2,
DpChargeMyParty2,
Reserved_102,
Reserved_103,
Reserved_104,
Reserved_105,
Reserved_106,
Reserved_107,
Reserved_108,
Reserved_109,
Reserved_110
};
6 changes: 6 additions & 0 deletions DragaliaAPI.Shared/DragaliaAPI.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@
<None Update="Resources\StampData.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\AbilityData.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\AbilityLimitedGroup.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions DragaliaAPI.Shared/MasterAsset/MasterAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ public static class MasterAsset
public static readonly MasterAssetData<UseItem, UseItemData> UseItem =
new("UseItem.json", x => x.Id);

public static readonly MasterAssetData<int, AbilityData> AbilityData =
new("AbilityData.json", x => x.Id);

public static readonly MasterAssetData<int, AbilityLimitedGroup> AbilityLimitedGroup =
new("AbilityLimitedGroup.json", x => x.Id);

#region Missions

public static readonly MasterAssetData<int, AlbumMission> AlbumMission =
Expand Down
19 changes: 18 additions & 1 deletion DragaliaAPI.Shared/MasterAsset/Models/AbilityCrest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ public record AbilityCrest(
Materials UniqueBuildupMaterialId,
Materials DuplicateEntityId,
int DuplicateEntityQuantity,
EntityTypes DuplicateEntityType
EntityTypes DuplicateEntityType,
int Abilities11,
int Abilities12,
int Abilities13,
int Abilities21,
int Abilities22,
int Abilities23
)
{
public int GetBuildupGroupId(BuildupPieceTypes type, int step) =>
Expand All @@ -22,4 +28,15 @@ public int GetBuildupGroupId(BuildupPieceTypes type, int step) =>
new List<KeyValuePair<Materials, int>>() { new(DuplicateEntityId, DuplicateEntityQuantity) }
.Where(x => x.Key != Materials.Empty)
.ToDictionary(x => x.Key, x => x.Value);

public IEnumerable<int> GetAbilities(int level)
{
return level switch
{
1 => new[] { Abilities11, Abilities21 },
2 => new[] { Abilities12, Abilities22 },
3 => new[] { Abilities13, Abilities23 },
_ => Enumerable.Empty<int>()
};
}
};
11 changes: 11 additions & 0 deletions DragaliaAPI.Shared/MasterAsset/Models/AbilityData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using DragaliaAPI.Shared.Definitions.Enums;

namespace DragaliaAPI.Shared.MasterAsset.Models;

public record AbilityData(
int Id,
AbilityTypes AbilityType1,
double AbilityType1UpValue,
int AbilityLimitedGroupId1,
int EventId
);
3 changes: 3 additions & 0 deletions DragaliaAPI.Shared/MasterAsset/Models/AbilityLimitedGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace DragaliaAPI.Shared.MasterAsset.Models;

public record AbilityLimitedGroup(int Id, double MaxLimitedValue);
1 change: 1 addition & 0 deletions DragaliaAPI.Shared/Resources/AbilityData.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions DragaliaAPI.Shared/Resources/AbilityLimitedGroup.json

Large diffs are not rendered by default.

Loading

0 comments on commit 3ed5ef9

Please sign in to comment.