[OSP][Code]Death/Wound/Recovery upon knockout scheme by Chel

Users who are viewing this thread

Status
Not open for further replies.
Can someone help me with where exact to paste this? I am using WRECK integrated modsys.

I went to my mission template py file but can't tell where he means exactly.

Thank you.
 
lovely code should not be forgotten

some additions to make it more easy

in module game menus post here so you dont declare it twice
Code:
("start_game_1",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "Select your character's gender.",
    "none",
    [
		   (assign, "$wound1", 0),
           (assign, "$wound2", 0),
           (assign, "$wound3", 0),
           (assign, "$wound4", 0),
           (assign, "$wound5", 0),
           (assign, "$wound6", 0),
           (assign, "$wound7", 0),
           (assign, "$wound8", 0),


           (assign, "$healday1", 0),
           (assign, "$healday2", 0),
           (assign, "$healday3", 0),
           (assign, "$healday4", 0),
           (assign, "$healday5", 0),
           (assign, "$healday6", 0),
           (assign, "$healday7", 0),
           (assign, "$healday8", 0),

           (assign, "$playerdead", 0),
          ],

in module mission templates add this with the common's
Code:
common_first_dead = (
  0, 2, ti_once, [(main_hero_fallen)],
  [
      (display_message,"@You have received a serious blow. The pain is unbearable."),
      (play_sound,"snd_player_breath"),  
    ])
	
common_second_dead = (
  0, 4, ti_once, [(main_hero_fallen)],
  [
      (display_message,"@Breathe in..."),  
    ])
	
common_third_dead = (
  0, 6, ti_once, [(main_hero_fallen)],
  [
      (display_message,"@Breathe out..."),  
    ])
	
common_final_dead = (    
0, 8, ti_once, [(main_hero_fallen)],
  [
       (display_message,"@ You make an effort to take another breath... "),

       (store_random_in_range,reg25,1,101),  ## chance
       (store_random_in_range,reg26,1,101),  ## wound type

       (try_begin), #pos 1
		(player_has_item,"itm_charm_a"),
        (val_add,reg25,1),

        (display_message,"@Your life charm glows softly "),
       (try_end),

       (try_begin), #pos 2
        (player_has_item,"itm_charm_c"),
        (val_add,reg25,30),
            
        (display_message,"@Your death ward starts to smoke and disappears"),
        (troop_remove_item,"trp_player","itm_charm_c"),
       (try_end),

       (try_begin),
        (lt,reg25,3),  ## instant kill 2% chance
        (val_add,reg25,-100),
       (try_end),

	   (try_begin),
        (player_has_item,"itm_charm_a"),
        (val_add,reg25,6),
       (try_end),
            
		(store_skill_level,"$ironflesh","skl_ironflesh","trp_player"),
        (store_skill_level,"$aid","skl_first_aid","trp_player"),
        (store_skill_level,"$wound","skl_wound_treatment","trp_player"),
        (store_skill_level,"$surg","skl_surgery","trp_player"),
        (store_attribute_level,"$charis","trp_player",3),            

##   bonuses to outcome of knockout
            (val_sub,"$charis",10),
            (val_add,reg25,"$ironflesh"),
            (val_add,reg25,"$charis"),            



### decide outcome
           (try_begin),
             (gt,reg25,50),  # complete recovery, scratches bruises, no wounds
             (display_message,"@ You will recover from this blow completely."),           
           (else_try),
             (gt,reg25,35), # 35-50 light wound
##################### wound type
##
          (try_begin),
             (gt,reg26,75),
 
            (display_message,"@ You suffer a deep cut on your arm. (-1 strength)"),           
            (assign, "$wound1", 1),

            (assign, "$healtime1", 31),
            (val_sub,"$healtime1","$aid"),
            (val_sub,"$healtime1","$wound"),
            (val_sub,"$healtime1","$surg"),
            (store_current_day,"$currentday1"),
            (store_add,"$healday1","$currentday1","$healtime1"),

            (troop_raise_attribute,"trp_player",0,-1),

            
         (else_try),
             (gt,reg26,50), #
            (display_message,"@ You suffer a nasty cut on your torso. (-1 strength, -1 agility)"),           
            (assign, "$wound2", 1),

            (assign, "$healtime2", 31),
            (val_sub,"$healtime2","$aid"),
            (val_sub,"$healtime2","$wound"),
            (val_sub,"$healtime2","$surg"),
            (store_current_day,"$currentday2"),
            (store_add,"$healday2","$currentday2","$healtime2"),

            (troop_raise_attribute,"trp_player",1,-1),
            (troop_raise_attribute,"trp_player",0,-1),

         (else_try),
             (gt,reg26,25), ## 

            (display_message,"@ You suffer a blow to the head. (-1 intelligence)"),           
            (assign, "$wound3", 1),

            (assign, "$healtime3", 31),
            (val_sub,"$healtime3","$aid"),
            (val_sub,"$healtime3","$wound"),
            (val_sub,"$healtime3","$surg"),
            (store_current_day,"$currentday3"),
            (store_add,"$healday3","$currentday3","$healtime3"),

            (troop_raise_attribute,"trp_player",2,-1),
            
        (else_try),  ## 

            (display_message,"@ You suffer a severe blow to your leg. (-1 agility)"),           
            (assign, "$wound4", 1),

            (assign, "$healtime4", 31),
            (val_sub,"$healtime4","$aid"),
            (val_sub,"$healtime4","$wound"),
            (val_sub,"$healtime4","$surg"),
            (store_current_day,"$currentday4"),
            (store_add,"$healday4","$currentday4","$healtime4"),

            (troop_raise_attribute,"trp_player",1,-1),            

        (try_end),
##            
#######################

           (else_try),
             (gt,reg25,20), ## 21-35 serious wound

         (try_begin),
             (gt,reg26,75),

            (display_message,"@ You suffer a broken arm. (-3 strength, -1 power strike, -1 power draw)"),           
            (assign, "$wound5", 1),

            (assign, "$healtime5", 31),
            (val_sub,"$healtime5","$aid"),
            (val_sub,"$healtime5","$wound"),
            (val_sub,"$healtime5","$surg"),
            (store_current_day,"$currentday5"),
            (store_add,"$healday5","$currentday5","$healtime5"),

            (troop_raise_attribute,"trp_player",0,-3),
            (troop_raise_skill, "trp_player","skl_power_strike",-1),
            (troop_raise_skill, "trp_player","skl_power_draw",-1),            

            
         (else_try),
             (gt,reg26,50), #
            (display_message,"@ You suffer a broken rib. (-2 strength, -2 agility, -1 ironflesh)"),           
            (assign, "$wound6", 1),

            (assign, "$healtime6", 31),
            (val_sub,"$healtime6","$aid"),
            (val_sub,"$healtime6","$wound"),
            (val_sub,"$healtime6","$surg"),
            (store_current_day,"$currentday6"),
            (store_add,"$healday6","$currentday6","$healtime6"),

            (troop_raise_attribute,"trp_player",1,-2),
            (troop_raise_attribute,"trp_player",0,-2),
            (troop_raise_skill, "trp_player","skl_ironflesh",-1),            

         (else_try),
             (gt,reg26,25), ## 

            (display_message,"@ You suffer a heavy blow to the head. (-2 intelligence, -1 leadership, -1 tactics)"),           
            (assign, "$wound7", 1),

            (assign, "$healtime7", 31),
            (val_sub,"$healtime7","$aid"),
            (val_sub,"$healtime7","$wound"),
            (val_sub,"$healtime7","$surg"),
            (store_current_day,"$currentday7"),
            (store_add,"$healday7","$currentday7","$healtime7"),

            (troop_raise_attribute,"trp_player",2,-2),
            (troop_raise_skill, "trp_player","skl_leadership",-1),
            (troop_raise_skill, "trp_player","skl_tactics",-1),            
            
            
        (else_try),  ## 

            (display_message,"@ You suffer a broken leg. (-3 agility, -1 athletics, -1 riding)"),           
            (assign, "$wound8", 1),

            (assign, "$healtime8", 31),
            (val_sub,"$healtime8","$aid"),
            (val_sub,"$healtime8","$wound"),
            (val_sub,"$healtime8","$surg"),
            (store_current_day,"$currentday8"),
            (store_add,"$healday8","$currentday8","$healtime8"),

            (troop_raise_attribute,"trp_player",1,-3),
            (troop_raise_skill, "trp_player","skl_riding",-1),
            (troop_raise_skill, "trp_player","skl_athletics",-1),            

        (try_end),

           (else_try),  ## 0-20 death
           (store_attribute_level,reg11,"trp_player",0),
           (store_attribute_level,reg12,"trp_player",1),
           (store_attribute_level,reg13,"trp_player",2),
           (store_attribute_level,reg14,"trp_player",3),
           (store_character_level,reg15,"trp_player"),
           (store_troop_gold,reg16,"trp_player"),
           (get_player_agent_kill_count,reg17,0),
           (store_current_day,reg18),

           
           (troop_clear_inventory,"trp_player"),
              (str_store_troop_name,s5,"trp_player"),
              (add_xp_to_troop,-1000,"trp_player"),
              (assign, "$playerdead", 1),
             (troop_add_item,"trp_player","itm_ghost_helm_a"),
             (troop_remove_gold,"trp_player",reg16),
            (troop_raise_attribute,"trp_player",0,10),            
             (dialog_box,"str_s5_score"),
           (try_end),
    ])

then simply declare the name of the commons
 
Status
Not open for further replies.
Back
Top Bottom