1
0
mirror of synced 2024-11-27 17:00:50 +01:00

extra character puchi unlockable

This commit is contained in:
0auBSQ 2024-06-23 11:37:23 +09:00
parent 16b2865422
commit 2926404c0f
6 changed files with 98 additions and 1 deletions

View File

@ -17,6 +17,7 @@ namespace TJAPlayer3
rarity = ra;
reference = re;
_isSet = false;
// TODO: Add an int (?) or string to find the Puchichara/Character/Song asset to display it
}
public void tSetupModal()
@ -180,6 +181,8 @@ namespace TJAPlayer3
Title = 3,
Text = 4,
Confirm = 5,
Song = 6,
Total = 7,
}
// Full : 1P standard modal, Half : Splitted screen modal
@ -244,6 +247,18 @@ namespace TJAPlayer3
{
content = (string)reference;
}
else if (modalType == EModalType.Character)
{
content = (string)reference;
}
else if (modalType == EModalType.Puchichara)
{
content = (string)reference;
}
else if (modalType == EModalType.Song)
{
content = (string)reference;
}
TitleTextureKey _content = new TitleTextureKey(
content,

View File

@ -72,6 +72,8 @@ namespace TJAPlayer3
public void tRegisterAIBattleModePlay(bool IsWon)
{
data.AIBattleModePlaycount++;
if (IsWon) data.AIBattleModeWins++;
DBSaves.RegisterAIBattleModePlay(data.SaveId, IsWon);
}

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using FDK;
using System.IO;
using static TJAPlayer3.DBNameplateUnlockables;
namespace TJAPlayer3
{
@ -25,6 +26,38 @@ namespace TJAPlayer3
return mult;
}
public void tGetUnlockedItems(int _player, ModalQueue mq)
{
int player = TJAPlayer3.GetActualPlayer(_player);
var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedCharacters;
bool _edited = false;
var _npvKey = Path.GetFileName(_path);
if (!_sf.Contains(_npvKey))
{
var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false;
if (_fulfilled)
{
_sf.Add(_npvKey);
_edited = true;
mq.tAddModal(
new Modal(
Modal.EModalType.Character,
HRarity.tRarityToModalInt(metadata.Rarity),
_npvKey
),
_player);
DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_characters", _npvKey);
}
}
if (_edited)
TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges();
}
public CCharacter(string path)
{
_path = path;

View File

@ -30,6 +30,38 @@ namespace TJAPlayer3
return mult;
}
public void tGetUnlockedItems(int _player, ModalQueue mq)
{
int player = TJAPlayer3.GetActualPlayer(_player);
var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedPuchicharas;
bool _edited = false;
var _npvKey = Path.GetFileName(_path);
if (!_sf.Contains(_npvKey))
{
var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false;
if (_fulfilled)
{
_sf.Add(_npvKey);
_edited = true;
mq.tAddModal(
new Modal(
Modal.EModalType.Puchichara,
HRarity.tRarityToModalInt(metadata.Rarity),
_npvKey
),
_player);
DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_puchicharas", _npvKey);
}
}
if (_edited)
TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges();
}
public CPuchichara(string path)
{
_path = path;

View File

@ -8,6 +8,7 @@ using System.Collections.Generic;
using DiscordRPC;
using static TJAPlayer3.CActSelect曲リスト;
using System.Text;
using System.ArrayExtensions;
namespace TJAPlayer3
{
@ -665,7 +666,21 @@ namespace TJAPlayer3
this.nEarnedMedalsCount[i]),
i);
TJAPlayer3.Databases.DBNameplateUnlockables.tGetUnlockedItems(i, mqModals);
// Check unlockables
{
TJAPlayer3.Databases.DBNameplateUnlockables.tGetUnlockedItems(i, mqModals);
foreach (var puchi in TJAPlayer3.Tx.Puchichara)
{
puchi.tGetUnlockedItems(i, mqModals);
}
foreach (var chara in TJAPlayer3.Tx.Characters)
{
chara.tGetUnlockedItems(i, mqModals);
}
}
}
displayedModals = new Modal[] { null, null, null, null, null };