sex_macro.ts 931 B

12345678910111213141516171819202122232425262728293031323334353637
  1. const enum ESexEncounterFamiliarity{
  2. LOVE="love",
  3. FRIEND="friend",
  4. ACQUAINTANCE="acquaintance",
  5. STRANGER="stranger"
  6. }
  7. const enum ESexEncounterType {
  8. VAGINAL="vaginal",
  9. ANAL="anal",
  10. BJ_GIVE="bj_give",
  11. BJ_RECEIVE="bj_receive",
  12. HJ_GIVE="hj_give",
  13. HJ_RECEIVE="hj_receive"
  14. }
  15. Macro.add('sex', {
  16. skipArgs : false,
  17. handler : function () {
  18. try {
  19. const pc = State.variables.pc;
  20. const npcIdOrObject:NPC|string = this.args[0];
  21. const flags:{[key:string]:any} = this.args[1] ?? {};
  22. pc.sexEncounterRegister(
  23. npcIdOrObject,
  24. flags.type ?? ESexEncounterType.VAGINAL,
  25. flags.fam ?? ESexEncounterFamiliarity.ACQUAINTANCE,
  26. flags.aware ?? true,
  27. flags.time ?? State.variables.time.now
  28. )
  29. }
  30. catch (ex) {
  31. return this.error('ERROR in sex-widget: ' + ex.message);
  32. }
  33. }
  34. });