3
0

moodlets.tw 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. :: moodletTest[test]
  2. <<set $pc.mood = 48>>
  3. :: moodletWidgets[widget]
  4. <<widget 'mood'>>
  5. <<set _moodletId = _args[0]>>
  6. <<set _moodletTimeIncrease = _args[1]>>
  7. <<if _moodletTimeIncrease > 0>>
  8. <<run $pc.moodletIncTime(_moodletId,_moodletTimeIncrease)>><!-- Make sure that this moodlet does not detoriate -->
  9. <<addtime _moodletTimeIncrease>>
  10. <<else>>
  11. <<set _moodletTimeIncrease = Math.abs(_moodletTimeIncrease)>>
  12. <</if>>
  13. <<run $pc.moodletApplyById(_moodletId,_moodletTimeIncrease)>>
  14. <<set _moodletData = setup.getMoodlet(_moodletId)>>
  15. <<set _moodletGroupData = setup.getMoodletGroup(_moodletData.group ?? 'none')>>
  16. <<set _moodletStyleClass="moodlet">>
  17. <<if _moodletData.effect == 0>>
  18. <<set _moodletStyleClass+=" neutral">>
  19. <<elseif _moodletData.effect < 0>>
  20. <<set _moodletStyleClass+=" negative">>
  21. <<else>>
  22. <<set _moodletStyleClass+=" positive">>
  23. <</if>>
  24. <div @class="_moodletStyleClass">
  25. <span class="effectStrength"><<if _moodletData.effect > 0>>+<</if>>_moodletData.effect</span>
  26. <span class="title">_moodletData.title</span>
  27. <span class="description">_moodletData.description</span>
  28. <span class="symbols">
  29. <<switch _moodletGroupData.accumulationMode>>
  30. <<case setup.moodletAccumulationMode.HIGHEST>>
  31. <<textWithTooltip "🔝">>
  32. <h3>Top only</h3>
  33. This mood effect is part of a group where only the strongest positive effect is applied.
  34. For example, if you watch TV on a bad TV and then on a good TV, only the stronger effect of the good TV is applied (the weak effect might still be in effect after the stronger ended, though).
  35. <</textWithTooltip>>
  36. <<case setup.moodletAccumulationMode.LOWEST>>
  37. <<textWithTooltip "🔝">>
  38. <h3>Top only</h3>
  39. This mood effect is part of a group where only the strongest negative effect is applied.
  40. For example, being insulted is not taken into account if you are also bullied.
  41. <</textWithTooltip>>
  42. <<case setup.moodletAccumulationMode.DIMINISHING>>
  43. <<textWithTooltip "🔼">>
  44. <h3>Diminishing return on investment</h3>
  45. This mood effect is part of a group where the strongest effect is taken into full account, while all other effects have reduced effects.
  46. For example, in the group <i>Candy</i>, eating chocolate gives you the same mood bonus as eating cake. Eating both gives you the bonus of eating chocolate and 50% of the effect of eating cake.
  47. <</textWithTooltip>>
  48. <<case setup.moodletAccumulationMode.ADD>>
  49. <<textWithTooltip "🔃">>
  50. <h3>Summed up effect</h3>
  51. This mood effect is part of a group where all effects are summed up.
  52. This is usually the case for effects which have very little in common with other effects.
  53. <</textWithTooltip>>
  54. <</switch>>
  55. <<switch _moodletData.timeMode>>
  56. <<case 0>>
  57. <<textWithTooltip "🔁">>
  58. <h3>Repeatable</h3>
  59. This mood effect can be gained multiple times. This will increase the time it is active, up to a maximum number of minutes.
  60. For example, you can make the effect of watching TV last longer by watching more TV.
  61. <</textWithTooltip>>
  62. <<case 1>>
  63. <<textWithTooltip "🔂">>
  64. <h3>Resetting</h3>
  65. When this mood effect is gained, it resets the time it is active.
  66. For example, the effect of gaining a compliment lasts for 4 hours. If you get another compliment 2 hours after you got the first one, the effect will last for 6 hours (2 of the first and 4 of the second compliment).
  67. <</textWithTooltip>>
  68. <<case 2>>
  69. <<textWithTooltip "🔚">>
  70. <h3>Lasting</h3>
  71. This mood effect will last until canceled. Depending on the effect, this might be an interaction with a NPC, sleeping for a specified amount of time, random chance or anything else.
  72. <</textWithTooltip>>
  73. <</switch>>
  74. </span>
  75. </div>
  76. <</widget>>