Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyoko-Jeremie committed Jul 28, 2024
1 parent 16eabb5 commit cb35b26
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/Cheats/Restraint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ export class CurseWears {
return Object.keys(KDEventHexModular);
}

get ShadowCurseBuffSpecialNameList(): string[] {
return Object.keys(KDApplyVariants);
}

get ShadowCurseVariantNameList(): string[] {
let v = [];
for (const T of Object.keys(KDHexVariantList)) {
Expand Down Expand Up @@ -484,6 +488,7 @@ export class CurseWears {
// hook for Game/src/item/KinkyDungeonLoot.js :
// let curs = KDGetByWeight(KinkyDungeonGetHexByListWeighted(Loot.hexlist, armor, false, Loot.hexlevelmin, Loot.hexlevelmax, [hexVariant, ...hex_extra]));
// hook for Game/src/item/KinkyDungeonRestraints.js in function KinkyDungeonGetHexByListWeighted() :
// KDApplyVariants + KDHexVariantList
// let list = KinkyDungeonGetHexByList(List, includeOrig, minLevel, maxLevel);
KinkyDungeonGetHexByList: new CurseWearHook<string[]>('KinkyDungeonGetHexByList'),
// hook for Game/src/item/KinkyDungeonLoot.js :
Expand Down Expand Up @@ -561,12 +566,17 @@ export class CurseWears {
*
* @param shadowCurseName ShadowCurseNameList
* @param wearsName
* @param variantName ShadowCurseVariantNameList
* @param variantName ShadowCurseVariantNameList + ShadowCurseBuffSpecialNameList
*/
addShadowCurseWearWithVariant(shadowCurseName: string, wearsName: string | undefined, variantName: string) {
console.log('[CurseWears] addShadowCurseWearWithVariant', shadowCurseName, wearsName, variantName);
if (!this.ShadowCurseVariantNameList.includes(variantName)) {
console.error('addShadowCurseWearWithVariant variantName not in ShadowCurseVariantNameList', variantName);
// if (!this.ShadowCurseVariantNameList.includes(variantName) &&
// !this.ShadowCurseBuffSpecialNameList.includes(variantName)) {
// console.error('addShadowCurseWearWithVariant variantName not in ShadowCurseVariantNameList + ShadowCurseBuffSpecialNameList', variantName);
// return;
// }
if (!this.ShadowCurseBuffNameList.includes(variantName)) {
console.error('addShadowCurseWearWithVariant variantName not in ShadowCurseBuffNameList', variantName);
return;
}
this.curseWearHookTable.KinkyDungeonGetHexByList.enable([variantName]);
Expand Down
6 changes: 5 additions & 1 deletion src/GreasemonkeyScript/CreateGui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,11 @@ export class CreateGui {
label: StringTable['ShadowVariantSelect'],
type: 'select',
value: 'None',
options: ['None', ...thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.CurseWears.ShadowCurseVariantNameList.map(T => {
options: ['None', ...[
// ...thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.CurseWears.ShadowCurseVariantNameList,
// ...thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.CurseWears.ShadowCurseBuffSpecialNameList,
...thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.CurseWears.ShadowCurseBuffNameList,
].map(T => {
return `${T}|[${TextGet(`curseInfo${T}`)}]`;
})],
cssClassName: 'd-inline',
Expand Down
5 changes: 5 additions & 0 deletions src/WindowPatch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ declare global {
events: (data: KDHexEnchantEventsData) => KinkyDungeonEvent[],
}>;

/**
* @type {Record<string, ApplyVariant>}
*/
let KDApplyVariants: Record<string, ApplyVariant>;

function KinkyDungeonLootEvent(Loot, Floor, Replacemsg, Lock);

function KDGetEffLevel(): number;
Expand Down

0 comments on commit cb35b26

Please sign in to comment.