Scarlett Schäfer 2 سال پیش
والد
کامیت
5cc3cd296d
3فایلهای تغییر یافته به همراه28 افزوده شده و 8 حذف شده
  1. 3 1
      source/npc/family/dad.qsps
  2. 9 3
      source/npc/template/male.qsps
  3. 16 4
      source/util/npc.qsps

+ 3 - 1
source/npc/family/dad.qsps

@@ -3,7 +3,9 @@
 $npc_id = 'family_dad'
 
 if $ARGS[0] = 'info':
-    gs 'npc_template_male','info'
+    !gs 'npc_template_male','info'
+
+    $cnpc_template = 'male'
     
     $cnpc_name_first = 'Lars'
     $cnpc_name_last = $name_last_born

+ 9 - 3
source/npc/template/male.qsps

@@ -1,7 +1,7 @@
 # npc_template_male
 
-if $ARGS[0] = 'info':
-    ! Body
+if $ARGS[0] = 'set':
+    !{ Body
         ! Genitals
             cnpc_penis_flat = 92
             cnpc_penis_erect = 131
@@ -9,8 +9,14 @@ if $ARGS[0] = 'info':
             cnpc_penis_girth_erect = 117
         ! Structure
             cnpc_height = 180
-            cnpc_weight = 85 
+            cnpc_weight = 85 }
+    if $ARGS[2] = 'height': RESULT = rand(160,200)
+    if $ARGS[2] = 'weight': RESULT = rand(60,100)
 
+    *PL '<<$ARGS[1]>>.<<$ARGS[2]>> -> <<RESULT>>'
+
+    gs 'util_npc','setInt',$ARGS[1],$ARGS[2],RESULT
+    
 end
 
 -

+ 16 - 4
source/util/npc.qsps

@@ -395,17 +395,29 @@ elseif $ARGS[0] = 'get':
     if $ARGS[2] = 'age':
         result = FUNC('util_time','age',FUNC('util_npc','get',$ARGS[1],'birthday'))
     elseif $ARGS[2] = 'bmi':
-        if cnpc_weight > 0:
-            result = cnpc_weight * 10000
-            result = result / cnpc_height
-            result = result / cnpc_height
+        _height = FUNC('util_npc','get',$ARGS[1],'height')
+        _weight = FUNC('util_npc','get',$ARGS[1],'weight')
+        if _weight > 0:
+            result = _weight * 10000
+            result = result / _height
+            result = result / _height
         end
     else:
 
         if MID($ARGS[2],1,1) = '$':
             $RESULT = DYNEVAL ('$RESULT = $cnpc_'+MID($ARGS[2],2))
+
+            
         else
             RESULT = DYNEVAL ('RESULT = cnpc_'+$ARGS[2])
+
+            
+            if RESULT = -1: 
+                $_template = FUNC('util_npc','get',$ARGS[1],'$template')
+                RESULT = FUNC('npc_template_'+$_template,'set',$ARGS[1],$ARGS[2])
+            end
+
+            
         end
 
     end