Skip to content

Commit

Permalink
Merge pull request #77 from cyb3rpsych0s1s/chore/fixes
Browse files Browse the repository at this point in the history
Chore/fixes
  • Loading branch information
Roms1383 authored Aug 23, 2023
2 parents e7181f7 + b56ffc7 commit 504d022
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 74 deletions.
Binary file modified archive/packed/archive/pc/mod/Addicted.archive
Binary file not shown.
Binary file modified archive/source/archive/addicted/localization/en-us.json
Binary file not shown.
Binary file modified archive/source/archive/addicted/localization/fr-fr.json
Binary file not shown.
15 changes: 11 additions & 4 deletions archive/source/raw/addicted/localization/en-us.json.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Memory Booster",
"femaleVariant": "RAM Jolt",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Consumable-MemoryBooster"
Expand All @@ -223,14 +223,14 @@
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "{int_0}% Reflexes",
"femaleVariant": "{int_0}% Max Reflexes",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Withdrawn-BlackLace-Desc"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "{int_0}% Stamina",
"femaleVariant": "{int_0}% Max Stamina",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Withdrawn-Stamina-Booster-Desc"
Expand All @@ -244,7 +244,7 @@
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "{int_0}% Memory",
"femaleVariant": "{int_0}% Max RAM Units",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Withdrawn-Memory-Booster-Desc"
Expand Down Expand Up @@ -388,6 +388,13 @@
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Overdose-BlackLace-Desc"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "UNKNOWN",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Unknown"
}
]
}
Expand Down
68 changes: 41 additions & 27 deletions archive/source/raw/addicted/localization/fr-fr.json.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,13 @@
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Thresholds"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "A peine",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Threshold-Barely"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "V commence à être à peine accro à ce stade",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Threshold-Barely-Desc"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Passablement",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Threshold-Mildly"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "V commence à être passablement accro à ce stade",
Expand Down Expand Up @@ -181,42 +167,42 @@
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "BounceBack",
"femaleVariant": "Revitalisant",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Consumable-BounceBack"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Health Booster",
"femaleVariant": "Booster de Santé",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Consumable-HealthBooster"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "BlackLace",
"femaleVariant": "Lien Noir",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Consumable-BlackLace"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Stamina Booster",
"femaleVariant": "Booster d'Endurance",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Consumable-StaminaBooster"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Carry Capacity Booster",
"femaleVariant": "Booster de Charge",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Consumable-CarryCapacityBooster"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Memory Booster",
"femaleVariant": "Sursaut de Mémoire Vive",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Consumable-MemoryBooster"
Expand Down Expand Up @@ -244,49 +230,49 @@
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "{int_0}% Vigueur",
"femaleVariant": "{int_0}% Endurance max.",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Withdrawn-Stamina-Booster-Desc"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "{int_0}% Capacité d'encombrement",
"femaleVariant": "{int_0}% Capacité de charge",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Withdrawn-Capacity-Booster-Desc"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "{int_0}% Mémoire",
"femaleVariant": "{int_0}% Max d'unite de mémoire vive",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Withdrawn-Memory-Booster-Desc"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "En manque de Stamina Booster",
"femaleVariant": "Accro au Booster d'Endurance",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Craving-For-Stamina-Booster"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "En manque de Carry Capacity Booster",
"femaleVariant": "Accro au Booster de Charge",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Craving-For-Capacity-Booster"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "En manque de Memory Booster",
"femaleVariant": "Accro au Sursaut de Mémoire Vive",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Craving-For-Memory-Booster"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "En manque de Black Lace",
"femaleVariant": "Accro au Lien Noir",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Craving-For-BlackLace"
Expand Down Expand Up @@ -381,6 +367,34 @@
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Dismiss-Biomonitor"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Overdose de Lien Noir",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Edgerunning-BlackLace-Penalty"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "Sous l'emprise du Lien Noir",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Overdose-BlackLace"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "on dit que la surconsommation de Lien Noir peut entraîner des crises de Cyberpsychose",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Overdose-BlackLace-Desc"
},
{
"$type": "localizationPersistenceOnScreenEntry",
"femaleVariant": "INCONNU",
"maleVariant": "",
"primaryKey": 0,
"secondaryKey": "Mod-Addicted-Unknown"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/Addicted/Debug.reds
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ public func DebugBiomon() -> Void {
let event: ref<CrossThresholdEvent> = new CrossThresholdEvent();
let customer: ref<Customer> = new Customer();
customer.FirstName = "V";
customer.LastName = "UNKNOWN";
customer.LastName = GetLocalizedTextByKey(n"Mod-Addicted-Unknown");
customer.Age = "27";
customer.BloodGroup = "UNKNOWN";
customer.BloodGroup = GetLocalizedTextByKey(n"Mod-Addicted-Unknown");
customer.Insurance = "-";
let system: ref<AddictedSystem> = AddictedSystem.GetInstance(this.GetGame());
let symptoms = system.Symptoms();
Expand Down
30 changes: 28 additions & 2 deletions scripts/Addicted/System.reds
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public class AddictedSystem extends ScriptableSystem {
this.healerManager = null;
this.ShrinkDoses();
// ModSettings.UnregisterListenerToModifications(this);
}
Expand Down Expand Up @@ -252,6 +254,30 @@ public class AddictedSystem extends ScriptableSystem {
this.delaySystem.DelayCallbackNextFrame(callback);
}
public func ShrinkDoses() -> Void {
let consumption: ref<Consumption>;
let doses: array<Float>;
let dose: Float;
let shrinked: array<Float>;
let count: Int32;
let idx: Int32;
let ids = this.consumptions.Keys();
for id in ids {
consumption = this.consumptions.Get(id);
doses = consumption.doses;
count = ArraySize(doses);
if count > 100 {
shrinked = [];
idx = count - 100;
while idx < count {
dose = doses[idx];
ArrayPush(shrinked, dose);
}
consumption.doses = shrinked;
}
}
}
public func OnProcessStatusEffects(actionEffects: array<wref<ObjectActionEffect_Record>>) -> array<wref<ObjectActionEffect_Record>> {
if this.healerManager.ContainsHealerStatusEffects(actionEffects) {
return this.healerManager.AlterHealerStatusEffects(actionEffects);
Expand Down Expand Up @@ -353,9 +379,9 @@ public class AddictedSystem extends ScriptableSystem {
let customer: ref<Customer> = new Customer();
customer.FirstName = "V";
customer.LastName = "UNKNOWN";
customer.LastName = GetLocalizedTextByKey(n"Mod-Addicted-Unknown");
customer.Age = "27";
customer.BloodGroup = "UNKNOWN";
customer.BloodGroup = GetLocalizedTextByKey(n"Mod-Addicted-Unknown");
customer.Insurance = "-";
let symptoms = this.Symptoms();
Expand Down
39 changes: 0 additions & 39 deletions scripts/Addicted/helpers/Translations.reds
Original file line number Diff line number Diff line change
Expand Up @@ -91,43 +91,4 @@ public class Translations {
}
return "";
}
public static func Reaction(mood: Mood, gender: gamedataGender, opt language: String) -> CName {
if Equals(mood, Mood.Any) { return n""; }
let output: CName;
let choices: array<String>;
let size: Int32;
let which: Int32;
let prefix: String = Equals(gender, gamedataGender.Female) ? "fem_v" : "male_v";
if StrLen(language) == 0 { language = "en-us"; }
switch(mood) {
case Mood.Disheartened:
choices = Feeling.Disheartened();
break;
case Mood.Offhanded:
choices = Feeling.Offhanded();
break;
case Mood.Pestered:
choices = Feeling.Pestered();
break;
case Mood.Surprised:
choices = Feeling.Surprised();
break;
default:
choices = [];
break;
}
size = ArraySize(choices);
if size > 0 {
which = size > 1 ? RandRange(0, size -1) : 0;
output = StringToName("addicted" + "." + language + "." + prefix + "_" + choices[which]);
E(s"picked \(NameToString(output)) (\(which))");
return IsNameValid(output) ? output : n"";
}
return n"";
}
}

0 comments on commit 504d022

Please sign in to comment.