|
@@ -1,5 +1,17 @@
|
|
|
# set_npc_attraction
|
|
|
|
|
|
+!! set_npc_attraction function.
|
|
|
+!!
|
|
|
+!! Modify the attraction (analogous to appearance) and relative hotcat (analogous to hotcat) using the various preferences (set in npc_set_preference, standard preferences set in npcstatic stored in npc_standard_preferences)
|
|
|
+!! How to use:
|
|
|
+!! gs 'set_npc_attraction', $npc_code, max_hotcat_change
|
|
|
+!! $npc_code: the code of the npc for which we calculate. Examles: 'A12', 'B3', 'C13'
|
|
|
+!! max_hotcat_change: the maximum difference between npc_rel_hotcat and normal hotcat.
|
|
|
+!! Defaults to 2. When set negative, it is unbounded instead.
|
|
|
+!!
|
|
|
+!! Sets the npc_attraction[$npc_code] and npc_rel_hotcat[$npc_code] variables
|
|
|
+
|
|
|
+
|
|
|
!! We start with the player''s appearance and add modifiers based on the npc''s preferences.
|
|
|
npc_attraction[$ARGS[0]] = pcs_apprnc
|
|
|
|
|
@@ -29,7 +41,6 @@ killvar 'npc_trait_values'
|
|
|
killvar 'preferences_loop_start'
|
|
|
|
|
|
|
|
|
-
|
|
|
if npc_attraction[$ARGS[0]] <= 40:
|
|
|
npc_rel_hotcat[$ARGS[0]] = 1
|
|
|
|
|
@@ -61,6 +72,14 @@ else
|
|
|
npc_rel_hotcat[$ARGS[0]] = 10
|
|
|
end
|
|
|
|
|
|
+if ARGS[1] = 0: ARGS[1] = 2
|
|
|
+if ARGS[1] > 0:
|
|
|
+ if npc_rel_hotcat[$ARGS[0]] - hotcat > ARGS[1]:
|
|
|
+ npc_rel_hotcat[$ARGS[0]] = hotcat + ARGS[1]
|
|
|
+ elseif hotcat - npc_rel_hotcat > ARGS[1]:
|
|
|
+ npc_rel_hotcat[$ARGS[0]] = hotcat - ARGS[1]
|
|
|
+ end
|
|
|
+end
|
|
|
|
|
|
|
|
|
|