Browse Source

add `<<sex>>`

Stephan Fuchs 2 months ago
parent
commit
e3fcdc7293

+ 22 - 0
sugarcube/src/activities/sex/sex_macro.ts

@@ -13,3 +13,25 @@ const enum ESexEncounterType {
     HJ_GIVE="hj_give",
     HJ_RECEIVE="hj_receive"
 }
+
+Macro.add('sex', {
+	skipArgs : false,
+	handler  : function () {
+		try {
+			const pc = State.variables.pc;
+            const npcIdOrObject:NPC|string = this.args[0];
+            const flags:{[key:string]:any} = this.args[1] ?? {};
+
+            pc.sexEncounterRegister(
+                npcIdOrObject,
+                flags.type ?? ESexEncounterType.VAGINAL,
+                flags.fam ?? ESexEncounterFamiliarity.ACQUAINTANCE,
+                flags.aware ?? true,
+                flags.time ?? State.variables.time.now
+            )
+		}
+		catch (ex) {
+			return this.error('ERROR in sex-widget: ' + ex.message);
+		}
+	}
+});

+ 3 - 0
sugarcube/src/locations/pavlov/brothel/abduction.tw

@@ -51,6 +51,9 @@
 		He cleans your ass from the remains of whatever little was inside.
 		His dick is not the biggest one, but it is quite thick.
 		Your pussy is the first victim of his phallus, and after a short while he moves to your anus.
+
+		<<sex 'brothel_bar' `{type:['vaginal','anal']}`>>
+
 		Another jolt of pain runs through your bottom, but this time you fade away for sure...
 		/*<<set $anal_slip += 4>>
 		<<set $guy += 4>>