Skip to content

Commit

Permalink
SpellPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyoko-Jeremie committed Jan 31, 2024
1 parent 8930394 commit a2e174f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Cheats/Full.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {isSafeInteger} from 'lodash'
import {isNil} from 'lodash'
import {TickHook} from "./_TickHook";
import {Choice} from "./Choice";

Expand All @@ -8,7 +8,10 @@ class FullCheatsBase extends Choice {
KinkyDungeonChangeDistraction(n || 10, true, 1);
};
SetSpellPoints = (n?: number) => {
KinkyDungeonSpellPoints = n || 10000;
KinkyDungeonSpellPoints = isNil(n) ? 10000 : n;
};
ChangeSpellPoints = (n: number = 0) => {
KinkyDungeonSpellPoints += n;
};
SetAncientEnergy = (f?: number) => {
KDGameData.AncientEnergyLevel = f || 1.0
Expand Down
4 changes: 4 additions & 0 deletions src/GUI_StringTable/CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export const StringTable_CN: StringTableType = {
AddAllWeapon: '添加全部武器Weapon到背包',
AddAllKeyTools: '添加全部常规解锁工具',
RemoveAllKeyTools: '移除全部常规解锁工具',
'SpellPoints Section': '技能点 Section',
AddSpellPoints: '添加技能点',
ZeroSpellPoints: '清零技能点',
NegativeSpellPoints: '减少技能点',
'Relations Section': '关系 Section',
FullAllRelations: '最大化所有派系的关系',
ZeroAllRelations: '清零所有派系的关系',
Expand Down
4 changes: 4 additions & 0 deletions src/GUI_StringTable/EN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const StringTable_EN: StringTableType = {
AddAllWeapon: 'AddAllWeapon',
AddAllKeyTools: 'AddAllKeyTools',
RemoveAllKeyTools: 'RemoveAllKeyTools',
'SpellPoints Section': 'SpellPoints Section',
AddSpellPoints: 'SpellPoints',
ZeroSpellPoints: 'ZeroSpellPoints',
NegativeSpellPoints: 'SpellPoints',
'Relations Section': 'Relations Section',
FullAllRelations: 'FullAllRelations',
ZeroAllRelations: 'ZeroAllRelations',
Expand Down
5 changes: 5 additions & 0 deletions src/GUI_StringTable/StringTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ const StringTableKeys = [
'AddAllKeyTools',
'RemoveAllKeyTools',

'SpellPoints Section',
'AddSpellPoints',
'ZeroSpellPoints',
'NegativeSpellPoints',

'Relations Section',
'FullAllRelations',
'ZeroAllRelations',
Expand Down
31 changes: 31 additions & 0 deletions src/GreasemonkeyScript/CreateGui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,37 @@ export class CreateGui {
cssClassName: 'd-inline',
xgmExtendField: {bootstrap: {btnType: thisRef.btnType}},
},
[thisRef.rId()]: {
section: GM_config.create(StringTable['SpellPoints Section']),
type: 'br',
},
'AddSpellPoints': {
label: StringTable['AddSpellPoints'] + '+10',
type: 'button',
click() {
thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.ChangeSpellPoints(10);
},
cssClassName: 'd-inline',
xgmExtendField: {bootstrap: {btnType: thisRef.btnType}},
},
'ZeroSpellPoints': {
label: StringTable['ZeroSpellPoints'],
type: 'button',
click() {
thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.SetSpellPoints(0);
},
cssClassName: 'd-inline',
xgmExtendField: {bootstrap: {btnType: thisRef.btnType}},
},
'NegativeSpellPoints': {
label: StringTable['NegativeSpellPoints'] + '-10',
type: 'button',
click() {
thisRef.winRef.KinkyDungeonMod_EnchantedRestraints.Cheats.ChangeSpellPoints(-10);
},
cssClassName: 'd-inline',
xgmExtendField: {bootstrap: {btnType: thisRef.btnType}},
},
[thisRef.rId()]: {
section: GM_config.create(StringTable['Relations Section']),
type: 'br',
Expand Down

0 comments on commit a2e174f

Please sign in to comment.