2
0

definitions.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. setup.attributes = [
  2. 'stren',
  3. 'agil',
  4. 'vital',
  5. 'intel',
  6. 'react',
  7. 'sprt',
  8. 'chrsm',
  9. 'prcptn',
  10. 'magik',
  11. 'stren_plus',
  12. 'butt_tr',
  13. ]
  14. setup.proficiencies ??= {};
  15. setup.skills ??= {};
  16. setup.skills = Object.assign({
  17. jab: {attributes:[]},
  18. punch: {attributes:[]},
  19. kick: {attributes:[]},
  20. def: {attributes:[]},
  21. shoot: {attributes:[]},
  22. vokal: {attributes:[]},
  23. sewng: {attributes:[]},
  24. instrmusic: {attributes:[]},
  25. photoskl: {attributes:[]},
  26. artskls: {attributes:[]},
  27. danc: {attributes:[]},
  28. dancero: {attributes:[]},
  29. dancpol: {attributes:[]},
  30. chess: {attributes:[]},
  31. gaming: {attributes:[]},
  32. humint: {attributes:[]},
  33. persuas: {attributes:[]},
  34. run: {attributes:[]},
  35. vball: {attributes:[]},
  36. icesktng: {attributes:[]},
  37. wrstlng: {attributes:[]},
  38. ftbll: {attributes:[]},
  39. splcstng: {attributes:[]},
  40. observ: {attributes:[]},
  41. makupskl: {attributes:[]},
  42. compskl: {attributes:[]},
  43. comphckng: {attributes:[]},
  44. hndiwrk: {attributes:[]},
  45. servng: {attributes:[]},
  46. mdlng: {attributes:[]},
  47. medcn: {attributes:[]},
  48. heels: {attributes:[]},
  49. pool: {attributes:[]},
  50. inhib: {attributes:[]},
  51. perform: {attributes:[]},
  52. bushcraft: {attributes:[]},
  53. cleaning: {attributes:[]},
  54. bkbll: {attributes:[]},
  55. cheer: {attributes:[]},
  56. musicprod: {attributes:[]},
  57. songwrit: {attributes:[]},
  58. },setup.skills);
  59. for(const skillName of Object.keys(setup.skills)){
  60. setup.Overwrite.varRegister(
  61. skillName+"_lvl",
  62. (index)=>State.variables.PC.skills[skillName].level,
  63. (index,val:number)=>State.variables.PC.skills[skillName].level=val
  64. );
  65. setup.Overwrite.varRegister(
  66. skillName+"_exp",
  67. (index)=>State.variables.PC.skills[skillName].experience,
  68. (index,val:number)=>State.variables.PC.skills[skillName].experience=val
  69. );
  70. setup.Overwrite.varRegister(
  71. "pcs_"+skillName,
  72. (index)=>window.QSP['attsklupdate'][0] == 1 ? Math.floor(State.variables.PC.proficiencies[skillName].level) : (State.variables["QSPVAR_n_pcs_"+skillName]?.[index ?? 0] ?? 0),
  73. (index,val:number)=>State.variables["QSPVAR_n_pcs_"+skillName] = [val],
  74. );
  75. }
  76. for(const attributeId of setup.attributes){
  77. setup.Overwrite.varRegister(
  78. attributeId+"_lvl",
  79. (index)=>State.variables.PC.attributes[attributeId].level,
  80. (index,val:number)=>State.variables.PC.attributes[attributeId].level=val
  81. );
  82. setup.Overwrite.varRegister(
  83. attributeId+"_exp",
  84. (index)=>State.variables.PC.attributes[attributeId].experience,
  85. (index,val:number)=>State.variables.PC.attributes[attributeId].experience=val
  86. );
  87. setup.Overwrite.varRegister(
  88. "pcs_"+attributeId,
  89. (index)=>window.QSP['attsklupdate'][0] == 1 ? State.variables.PC.attributes[attributeId].level : (State.variables["QSPVAR_n_pcs_"+attributeId]?.[index ?? 0] ?? 0),
  90. (index,val:number)=>State.variables["QSPVAR_n_pcs_"+attributeId] = [val],
  91. );
  92. }