1
0
mirror of synced 2024-11-24 07:30:21 +01:00

Edit and improve effects methods

This commit is contained in:
0auBSQ 2023-08-19 02:54:55 +09:00
parent 8f6a622100
commit 8b72d09384
8 changed files with 91 additions and 63 deletions

View File

@ -11,11 +11,29 @@ namespace TJAPlayer3
public CharacterEffect()
{
Gauge = "Normal";
BombFactor = 20;
FuseRollFactor = 0;
}
public float GetCoinMultiplier()
{
float mult = 1f;
if (Gauge == "Hard") mult *= 1.5f;
if (Gauge == "Extreme") mult *= 1.8f;
return mult;
}
[JsonProperty("gauge")]
public string Gauge;
[JsonProperty("bombFactor")]
public int BombFactor;
[JsonProperty("fuseRollFactor")]
public int FuseRollFactor;
}
public class CharacterData

View File

@ -16,6 +16,16 @@ namespace TJAPlayer3
SplitLane = false;
}
public float GetCoinMultiplier()
{
float mult = 1f;
if (Autoroll > 0) mult *= 0f;
if (ShowAdlib == true) mult *= 0.9f;
if (AllPurple == true) mult *= 1.1f;
return mult;
}
[JsonProperty("allpurple")]
public bool AllPurple;

View File

@ -29,6 +29,16 @@ namespace TJAPlayer3
["Legendary"] = 4,
};
private static Dictionary<string, float> RarityToCoinMultiplier = new Dictionary<string, float>
{
["Poor"] = 0.8f,
["Common"] = 1f,
["Uncommon"] = 1.1f,
["Rare"] = 1.2f,
["Epic"] = 1.3f,
["Legendary"] = 1.5f,
};
public static Color tRarityToColor(string rarity)
{
@ -51,6 +61,16 @@ namespace TJAPlayer3
return modalInt;
}
public static float tRarityToRarityToCoinMultiplier(string rarity)
{
float coinMult = 1f;
if (RarityToCoinMultiplier.ContainsKey(rarity))
coinMult = RarityToCoinMultiplier[rarity];
return coinMult;
}
}
}

View File

@ -1872,22 +1872,30 @@ namespace TJAPlayer3
Random rnd = new System.Random();
var eFun = TJAPlayer3.ConfigIni.nFunMods[TJAPlayer3.GetActualPlayer(player)];
var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character];
var bombFactor = Math.Max(1, Math.Min(100, chara.effect.BombFactor));
var fuseRollFactor = Math.Max(0, Math.Min(100, chara.effect.FuseRollFactor));
switch (eFun)
{
case EFunMods.MINESWEEPER:
foreach (var chip in this.listChip)
{
int n = rnd.Next(100);
if (n >= 0 && n <= 20)
{
if (NotesManager.IsMissableNote(chip))
{
chip.nチャンネル番号 = 0x1C;
}
if (NotesManager.IsMissableNote(chip))
{
int n = rnd.Next(100);
if (n < bombFactor) chip.nチャンネル番号 = 0x1C;
}
if (NotesManager.IsBalloon(chip))
{
int n = rnd.Next(100);
if (n < fuseRollFactor) chip.nチャンネル番号 = 0x1D;
}
}
break;
case EFunMods.AVALANCHE:
@ -2029,19 +2037,13 @@ namespace TJAPlayer3
{
switch (chip.nチャンネル番号)
{
case 0x11:
chip.nチャンネル番号 = 0x101;
break;
case 0x12:
chip.nチャンネル番号 = 0x101;
break;
case 0x13:
case 0x1A:
chip.nチャンネル番号 = 0x101;
chip.nSenote = 6;
break;
case 0x14:
case 0x1B:
chip.nチャンネル番号 = 0x101;
chip.nSenote = 5;
break;
}
}

View File

@ -15,6 +15,16 @@ namespace TJAPlayer3
public DBUnlockables.CUnlockConditions unlock;
public string _path;
public float GetEffectCoinMultiplier()
{
float mult = 1f;
mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity);
mult *= effect.GetCoinMultiplier();
return mult;
}
public CCharacter(string path)
{
_path = path;

View File

@ -19,6 +19,16 @@ namespace TJAPlayer3
public DBUnlockables.CUnlockConditions unlock;
public string _path;
public float GetEffectCoinMultiplier()
{
float mult = 1f;
mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity);
mult *= effect.GetCoinMultiplier();
return mult;
}
public CPuchichara(string path)
{
_path = path;

View File

@ -482,52 +482,8 @@ namespace TJAPlayer3
var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character];
var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(player))];
float charamul = 1.0f;
switch(chara.metadata.Rarity)
{
case "Poor":
charamul = 0.8f;
break;
case "Common":
charamul = 1.0f;
break;
case "Uncommon":
charamul = 1.1f;
break;
case "Rare":
charamul = 1.2f;
break;
case "Epic":
charamul = 1.3f;
break;
case "Legendary":
charamul = 1.5f;
break;
}
float puchimul = 1.0f;
switch (puchichara.metadata.Rarity)
{
case "Poor":
puchimul = 0.8f;
break;
case "Common":
puchimul = 1.0f;
break;
case "Uncommon":
puchimul = 1.1f;
break;
case "Rare":
puchimul = 1.2f;
break;
case "Epic":
puchimul = 1.3f;
break;
case "Legendary":
puchimul = 1.5f;
break;
}
return charamul * puchimul;
return chara.GetEffectCoinMultiplier() * puchichara.GetEffectCoinMultiplier();
}
if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Tower)

View File

@ -1,3 +1,5 @@
{
"gauge":"Normal"
"gauge":"Normal",
"bombFactor":20,
"fuseRollFactor":0
}