Advertisement
picobyte

Untitled

Mar 25th, 2018
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 22.18 KB | None | 0 0
  1. commit f576c908f2ad167b28f8a1da801b5e75344899c9
  2. Author: picobyte <PiC.o0.o.BytE@gmail.com>
  3. Date:   Sun Mar 25 18:26:50 2018 +0200
  4.  
  5.     implement repeat action in chat
  6.    
  7.     Signed-off-by: picobyte <PiC.o0.o.BytE@gmail.com>
  8.  
  9. diff --git a/script.rpy b/script.rpy
  10. index 81c9a90..9fb0d5c 100644
  11. --- a/script.rpy
  12. +++ b/script.rpy
  13. @@ -11,6 +11,7 @@ init -2 python:
  14.      import math
  15.      import __builtin__
  16.      import pygame
  17. +    import re
  18.  #    import shader
  19.      
  20.      config.image_cache_size = 12    
  21. @@ -3344,7 +3345,6 @@ label create_outfit(the_outfit):
  22.  label game_loop: ##THIS IS THE IMPORTANT SECTION WHERE YOU DECIDE WHAT ACTIONS YOU TAKE
  23.      #"Now, what would you like to do? You can talk to someone, go somewhere else, perform an action, or reexamine the room."
  24.      python:
  25. -
  26.          tuple_list = [("Go somewhere else.", "Go somewhere else."), ("Examine the room.", "Examine the room.")]
  27.          act_ct = mc.location.valid_actions()
  28.          if act_ct < 5:
  29. @@ -3362,6 +3362,7 @@ label game_loop: ##THIS IS THE IMPORTANT SECTION WHERE YOU DECIDE WHAT ACTIONS Y
  30.              tuple_list.append(("Talk to someone.", "Talk to someone."))
  31.  
  32.          choice = renpy.display_menu(tuple_list,True,"Choice")
  33. +
  34.      if isinstance(choice, basestring):
  35.          if choice == "Go somewhere else.":
  36.              call screen map_manager
  37. @@ -3416,64 +3417,36 @@ label change_location(the_place):
  38.  #    "You spend some time travelling to [the_place.name]." #TODO: Only show this when there is a significant time use? Otherwise takes up too much time changing between locations.
  39.      return
  40.  
  41. -label talk_person(the_person):
  42. +label talk_person(the_person, repeat_choice = None):
  43.      $the_person.draw_person()
  44.      show screen person_info_ui(the_person)
  45.      hide screen business_ui
  46. -    
  47. +
  48.      menu:
  49.          "Finish talking.":
  50. +            $ repeat_choice = None
  51.              "Eventually you're done say goodbye to each other."
  52. +        "Repeat" if repeat_choice:
  53. +            # print the repeat choice and then replace characters so it can be called as a label
  54. +            "You [repeat_choice]"
  55. +            $ renpy.call(re.sub(' ', '_', repeat_choice))
  56. +
  57.          "Chat about something.":
  58. +            $ repeat_choice = None
  59.              menu:
  60.                  "Compliment her outfit.":
  61. -                    mc.name "Hey [the_person.name], I just wanted to say that you look great today. That style really suits you." #TODO: Add more context aware dialogue.
  62. -                    $ slut_difference = int(the_person.sluttiness - the_person.outfit.slut_requirement) #Negative if their outfit is sluttier than what they would normally wear.
  63. -                    # Note: The largest effect should occure when the outfit is just barely in line with her sluttiness. Too high or too low and it will have no effect.
  64. -                    
  65. -                    $ sweet_spot_range = 10
  66. -                    if slut_difference < -sweet_spot_range : #Outfit is too slutty, she will never get use to wearing it.
  67. -                        $ the_person.draw_person(emotion = "default")
  68. -                        the_person.name "Really? It's just so revealing, what do people think of me when they see me? I don't think I'll ever get use to wearing this."                  
  69. -                        
  70. -                    elif slut_difference > sweet_spot_range:  #Outfit is conservative, no increase.
  71. -                        $ the_person.draw_person(emotion = "default")
  72. -                        the_person.name "Really? I think it looks too bland, showing a little more skin would be nice."
  73. -                        
  74. -                    else: #We are within the sweet_spot_range with the outfit.
  75. -                        $ slut_difference = math.fabs(slut_difference)
  76. -                        if slut_difference > sweet_spot_range:
  77. -                            $ slut_difference = sweet_spot_range
  78. -                        $ slut_difference = sweet_spot_range - slut_difference #invert the value so we now have 10 - 10 at both extreme ends, 10 - 0 at the middle where it will have the most effect.
  79. -                        $ change_amount = the_person.change_slut_modified(mc.charisma + 1 + slut_difference) #Increase their sluttiness if they are suggestable right now.
  80. -                        show screen float_up_screen(["+[change_amount] Sluttiness"],["float_text_pink"])
  81. -                        the_person.name "Glad you think so, I was on the fence, but it's nice to know that somebody likes it!"
  82. -                        
  83. +                    $ repeat_choice = "compliment her outfit"
  84. +                    call compliment_her_outfit from chat_compliment_outfit
  85.                  "Flirt with her.":
  86. -                    mc.name "Hey [the_person.name], you're looking particularly good today. I wish I got to see a little bit more of that fabulous body."
  87. -                    $ change_amount = the_person.change_slut_modified(mc.charisma + 1)
  88. -                    show screen float_up_screen(["+[change_amount] Sluttiness"],["float_text_pink"])
  89. -                    $the_person.call_flirt_response()
  90. -                    
  91. +                    $ repeat_choice = "flirt with her"
  92. +                    call flirt_with_her  from chat_flirt
  93.                  "Compliment her recent work." if mc.business.get_employee_workstation(the_person):
  94. -                    mc.name "[the_person.name], I wanted to tell you that you've been doing a great job lately. Keep it up, you're one of hte most important players in this whole operation."
  95. -                    $ change_amount = mc.charisma + 1
  96. -                    $ change_amount_obedience = the_person.change_obedience_modified(-change_amount)
  97. -                    $ the_person.change_happiness(change_amount)
  98. -                    $ the_person.draw_person(emotion = "happy")
  99. -                    show screen float_up_screen(["+[change_amount] Happiness","[change_amount_obedience] Obedience"],["float_text_yellow","float_text_grey"])
  100. -                    the_person.name "Thanks [mc.name], it means a lot to hear that from you. I'll just keep doing what I'm doing I guess."                    
  101. -                    
  102. +                    $ repeat_choice = "compliment her recent work"
  103. +                    call compliment_her_recent_work  from chat_compliment_work
  104.                  "Insult her recent work." if mc.business.get_employee_workstation(the_person):
  105. -                    mc.name "[the_person.name], I have to say I've been disappointed in your work for a little while now. Try to shape up, or we'll have to have a more offical talk about it."
  106. -                    $ change_amount = mc.charisma*2 + 1
  107. -                    $ change_amount_happiness = 5-mc.charisma
  108. -                    $ change_amount= the_person.change_obedience_modified(change_amount)
  109. -                    $ the_person.change_happiness(-change_amount_happiness)
  110. -                    $ the_person.draw_person(emotion = "sad")
  111. -                    show screen float_up_screen(["-[change_amount_happiness] Happiness","+[change_amount] Obedience"],["float_text_yellow","float_text_grey"])
  112. -                    the_person.name "Oh... I didn't know there was an issue. I'll try follow your instructions closer then."
  113. -                    
  114. +                    $ repeat_choice = "insult her recent work"
  115. +                    call insult_her_recent_work  from chat_insult
  116. +
  117.                  "Offer a cash bonus." if  mc.business.get_employee_workstation(the_person):
  118.                      mc.name "So [the_person.name], you've been putting in a lot of good work at the lab lately and I wanted to make sure you were rewarded properly for that."
  119.                      "You pull out your wallet and start to pull out a few bills."
  120. @@ -3488,8 +3461,8 @@ label talk_person(the_person):
  121.                              show screen float_up_screen(["-[change_amount] Happiness"],["float_text_yellow"])
  122.                              $the_person.change_happiness(-change_amount)
  123.                              "[the_person.name] looks visibly disapointed."
  124. -                            the_person.name "Right, of course."                          
  125. -                        
  126. +                            the_person.name "Right, of course."
  127. +
  128.                          "Give her a days wages. -$[the_person.salary]" if mc.money >= the_person.salary:
  129.                              mc.name "Here you go, treat yourself to something nice tonight."
  130.                              $ the_person.draw_person(emotion = "happy")
  131. @@ -3497,9 +3470,8 @@ label talk_person(the_person):
  132.                              show screen float_up_screen(["+[change_amount] Happiness"],["float_text_yellow"])
  133.                              $ the_person.change_happiness(change_amount)
  134.                              "[the_person.name] takes the bills from you and smiles."
  135. -                            the_person.name "Thank you sir."                    
  136. -                            
  137. -                            
  138. +                            the_person.name "Thank you sir."
  139. +
  140.                          "Give her a weeks wages. -$[weeks_wages]" if mc.money >= weeks_wages:
  141.                              mc.name "Here you go, don't spend it all in once place."
  142.                              $ the_person.draw_person(emotion = "happy")
  143. @@ -3510,7 +3482,7 @@ label talk_person(the_person):
  144.                              show screen float_up_screen(["+[change_amount] Happiness","+[change_amount] Obedience"],["float_text_yellow","float_text_grey"])
  145.                              "[the_person.name] takes the bills, then smiles broadly at you."
  146.                              the_person.name "That's very generous of you sir, thank you."
  147. -                            
  148. +
  149.                          "Give her a months wages. -$[months_wages]" if mc.money >= months_wages:
  150.                              mc.name "Here, you're a key part of the team and you deserved to be rewarded as such."
  151.                              $ the_person.draw_person(emotion = "happy")
  152. @@ -3531,7 +3503,7 @@ label talk_person(the_person):
  153.                                  $ the_person.review_outfit()
  154.                              else:
  155.                                  the_person.name "Wow... this is amazing sir. I'll do everything I can for you and the company!"
  156. -                                
  157. +
  158.                          "Give her a permanent 10%% Raise ($[raise_amount]/day)":
  159.                              mc.name "[the_person.name], it's criminal that I pay you as little as I do. I'm going to mark you down for a 10%% raise, effective by the end of today."
  160.                              $ change_amount = 5+mc.charisma
  161. @@ -3541,11 +3513,11 @@ label talk_person(the_person):
  162.                              show screen float_up_screen(["+$[raise_amount]/day Salary","+[change_amount] Happiness","+[change_amount_obedience] Obedience"],["float_text_green","float_text_yellow","float_text_grey"])
  163.                              $ the_person.salary += raise_amount
  164.                              the_person.name "Thank you sir, that's very generous of you!"
  165. -                        
  166. -                    
  167. -            call talk_person(the_person) from _call_talk_person_4
  168. -                
  169. +
  170. +                    call talk_person(the_person) from _call_talk_person_4
  171. +
  172.          "Modify her wardrobe." if the_person.obedience >= 120:
  173. +            $ repeat_choice = None
  174.              menu:
  175.                  "Add an outfit.":
  176.                      mc.name "[the_person.name], I've got something I'd like you to wear for me." ## Do we want a completely silent protag? Speaks only through menu input maybe?
  177. @@ -3592,10 +3564,10 @@ label talk_person(the_person):
  178.                      $ the_person.draw_person()
  179.                      show screen main_ui
  180.                      the_person.name "Is this better?"
  181. -                    
  182.              call talk_person(the_person) from _call_talk_person_1
  183.              
  184.          "Move her to a new division." if not mc.business.get_employee_title(the_person) == "None":
  185. +            $ repeat_choice = None
  186.              the_person.name "Where would you like me then?"
  187.              $ mc.business.remove_employee(the_person)
  188.              
  189. @@ -3631,6 +3603,7 @@ label talk_person(the_person):
  190.              the_person.name "I'll get started right away!"
  191.              
  192.          "Fire them!" if not mc.business.get_employee_title(the_person) == "None":
  193. +            $ repeat_choice = None
  194.              "You tell [the_person.name] to collect their things and leave the building."
  195.              $ mc.business.remove_employee(the_person) #TODO: check if we should actually be physically removing the person from the location without putting them somewhere else (person leak?)
  196.              if rd_division.has_person(the_person):
  197. @@ -3643,26 +3616,90 @@ label talk_person(the_person):
  198.                  $ m_division.remove_person(the_person)
  199.              
  200.          "Take a closer look at [the_person.name].":
  201. +            $ repeat_choice = None
  202.              call examine_person(the_person) from _call_examine_person
  203.              call talk_person(the_person) from _call_talk_person_2
  204.          "Give her a dose of serum." if mc.inventory.get_any_serum_count() > 0 and mandatory_serum_testing_policy.is_owned():
  205. -            $renpy.scene("Active")
  206. -            call give_serum(the_person) from _call_give_serum
  207. -            call talk_person(the_person) from _call_talk_person_3
  208. +            $ repeat_choice = "give her a dose of serum"
  209. +            call give_her_a_dose_of_serum
  210.          "Seduce her.":
  211. -            "You step close to [the_person.name] and hold her hand."
  212. -            $ the_person.call_seduction_response()
  213. -            call fuck_person(the_person) from _call_fuck_person
  214. -            #Now that you've had sex, we calculate the change to her stats and move on.
  215. -            $ change_amount = the_person.change_slut_modified(the_person.arousal) #Change her slut score by her final arousal. This should be _about_ 100 if she climaxed, but you may keep fucking her silly if you can overcome the arousal loss.
  216. -            show screen float_up_screen(["+[change_amount] Sluttiness"],["float_text_pink"])
  217. -            $ the_person.reset_arousal()
  218. -            $ the_person.review_outfit()
  219. +            $ repeat_choice = None
  220. +            call seduce_her from chat_seduce
  221. +    if repeat_choice:
  222. +        call talk_person(the_person, repeat_choice) from _call_talk_person_3
  223.      hide screen person_info_ui
  224.      show screen business_ui
  225.      $renpy.scene("Active")
  226.      return
  227. -    
  228. +
  229. +label compliment_her_outfit:
  230. +    mc.name "Hey [the_person.name], I just wanted to say that you look great today. That style really suits you." #TODO: Add more context aware dialogue.
  231. +    $ slut_difference = int(the_person.sluttiness - the_person.outfit.slut_requirement) #Negative if their outfit is sluttier than what they would normally wear.
  232. +    # Note: The largest effect should occure when the outfit is just barely in line with her sluttiness. Too high or too low and it will have no effect.
  233. +
  234. +    $ sweet_spot_range = 10
  235. +    if slut_difference < -sweet_spot_range : #Outfit is too slutty, she will never get use to wearing it.
  236. +        $ the_person.draw_person(emotion = "default")
  237. +        the_person.name "Really? It's just so revealing, what do people think of me when they see me? I don't think I'll ever get use to wearing this."
  238. +
  239. +    elif slut_difference > sweet_spot_range:  #Outfit is conservative, no increase.
  240. +        $ the_person.draw_person(emotion = "default")
  241. +        the_person.name "Really? I think it looks too bland, showing a little more skin would be nice."
  242. +
  243. +    else: #We are within the sweet_spot_range with the outfit.
  244. +        $ slut_difference = math.fabs(slut_difference)
  245. +        if slut_difference > sweet_spot_range:
  246. +            $ slut_difference = sweet_spot_range
  247. +        $ slut_difference = sweet_spot_range - slut_difference #invert the value so we now have 10 - 10 at both extreme ends, 10 - 0 at the middle where it will have the most effect.
  248. +        $ change_amount = the_person.change_slut_modified(mc.charisma + 1 + slut_difference) #Increase their sluttiness if they are suggestable right now.
  249. +        show screen float_up_screen(["+[change_amount] Sluttiness"],["float_text_pink"])
  250. +        the_person.name "Glad you think so, I was on the fence, but it's nice to know that somebody likes it!"
  251. +    return
  252. +
  253. +label flirt_with_her:
  254. +    mc.name "Hey [the_person.name], you're looking particularly good today. I wish I got to see a little bit more of that fabulous body."
  255. +    $ change_amount = the_person.change_slut_modified(mc.charisma + 1)
  256. +    show screen float_up_screen(["+[change_amount] Sluttiness"],["float_text_pink"])
  257. +    $the_person.call_flirt_response()
  258. +    return
  259. +
  260. +label compliment_her_recent_work:
  261. +    mc.name "[the_person.name], I wanted to tell you that you've been doing a great job lately. Keep it up, you're one of hte most important players in this whole operation."
  262. +    $ change_amount = mc.charisma + 1
  263. +    $ change_amount_obedience = the_person.change_obedience_modified(-change_amount)
  264. +    $ the_person.change_happiness(change_amount)
  265. +    $ the_person.draw_person(emotion = "happy")
  266. +    show screen float_up_screen(["+[change_amount] Happiness","[change_amount_obedience] Obedience"],["float_text_yellow","float_text_grey"])
  267. +    the_person.name "Thanks [mc.name], it means a lot to hear that from you. I'll just keep doing what I'm doing I guess."
  268. +    return
  269. +
  270. +label insult_her_recent_work:
  271. +    mc.name "[the_person.name], I have to say I've been disappointed in your work for a little while now. Try to shape up, or we'll have to have a more offical talk about it."
  272. +    $ change_amount = mc.charisma*2 + 1
  273. +    $ change_amount_happiness = 5-mc.charisma
  274. +    $ change_amount= the_person.change_obedience_modified(change_amount)
  275. +    $ the_person.change_happiness(-change_amount_happiness)
  276. +    $ the_person.draw_person(emotion = "sad")
  277. +    show screen float_up_screen(["-[change_amount_happiness] Happiness","+[change_amount] Obedience"],["float_text_yellow","float_text_grey"])
  278. +    the_person.name "Oh... I didn't know there was an issue. I'll try follow your instructions closer then."
  279. +    return
  280. +
  281. +label give_her_a_dose_of_serum:
  282. +    $renpy.scene("Active")
  283. +    call give_serum(the_person) from _call_give_serum
  284. +    return
  285. +
  286. +label seduce_her:
  287. +    "You step close to [the_person.name] and hold her hand."
  288. +    $ the_person.call_seduction_response()
  289. +    call fuck_person(the_person) from _call_fuck_person
  290. +    #Now that you've had sex, we calculate the change to her stats and move on.
  291. +    $ change_amount = the_person.change_slut_modified(the_person.arousal) #Change her slut score by her final arousal. This should be _about_ 100 if she climaxed, but you may keep fucking her silly if you can overcome the arousal loss.
  292. +    show screen float_up_screen(["+[change_amount] Sluttiness"],["float_text_pink"])
  293. +    $ the_person.reset_arousal()
  294. +    $ the_person.review_outfit()
  295. +    return
  296. +
  297.  label fuck_person(the_person): #TODO: Add a conditional obedience and sluttiness increase for situations like blackmail or getting drunk
  298.      python:
  299.          tuple_list = []
  300. @@ -3675,14 +3712,17 @@ label fuck_person(the_person): #TODO: Add a conditional obedience and sluttiness
  301.          
  302.      if not position_choice == "Leave":
  303.          python:
  304. -            renpy.say("","Where do you do it?")
  305. -            
  306.              tuple_list = []
  307.              for object in mc.location.objects:
  308.                  if object.has_trait(position_choice.requires_location):
  309. -                    tuple_list.append([object.name,object])
  310. +                    tuple_list.append((object.name,object))
  311. +            if len(tuple_list) > 1:
  312. +                renpy.say("","Where do you do it?")
  313. +                object_choice = renpy.display_menu(tuple_list,True,"Choice")
  314. +            else:
  315. +                renpy.say("", "You decide to do it on the %s."%tuple_list[0][0])
  316. +                object_choice = tuple_list[0][1]
  317.              
  318. -            object_choice = renpy.display_menu(tuple_list,True,"Choice")
  319.          call sex_description(the_person, position_choice, object_choice, 0) from _call_sex_description
  320.      
  321.      return
  322.  
  323. commit 27ccd9114466c64321b997e3ed3a8a02f6a262d7
  324. Author: picobyte <PiC.o0.o.BytE@gmail.com>
  325. Date:   Sun Mar 25 18:25:57 2018 +0200
  326.  
  327.     In case of a single option don't show the menu, do it already.
  328.    
  329.     Signed-off-by: picobyte <PiC.o0.o.BytE@gmail.com>
  330.  
  331. diff --git a/screens.rpy b/screens.rpy
  332. index 1baebed..bad1cf7 100644
  333. --- a/screens.rpy
  334. +++ b/screens.rpy
  335. @@ -213,20 +213,27 @@ style input:
  336.  
  337.  screen choice(items):
  338.      style_prefix "choice"
  339. +    if (len(items) > 1):
  340.  
  341. -    #We want to have 2 vboxes, seperated so that they are staggered as they go down.
  342. -    vbox:
  343. -        xalign 0.34
  344. -        for i in items[0::2]:
  345. -            textbutton i.caption action i.action
  346. -    
  347. -    vbox:
  348. -        xalign 0.67
  349. -        if len(items)%2 == 0:
  350. -            null height 125 #Add an empty list element to keep the alignment correct if there are an even number of elements in both lists.
  351. -        for j in items[1::2]:
  352. -            textbutton j.caption action j.action
  353. +        #We want to have 2 vboxes, seperated so that they are staggered as they go down.
  354. +        vbox:
  355. +            xalign 0.34
  356. +            for i in items[0::2]:
  357. +                textbutton i.caption action i.action
  358. +
  359. +        vbox:
  360. +            xalign 0.67
  361. +            if len(items)%2 == 0:
  362. +                null height 125 #Add an empty list element to keep the alignment correct if there are an even number of elements in both lists.
  363. +            for j in items[1::2]:
  364. +                textbutton j.caption action j.action
  365. +    else:
  366. +        window:
  367. +            id "window"
  368.  
  369. +            text "You decide to %s"%items[0].caption id "what"
  370. +            for k in config.keymap['dismiss']:
  371. +                key k action items[0].action
  372.  
  373.  ## When this is true, menu captions will be spoken by the narrator. When false,
  374.  ## menu captions will be displayed as empty buttons.
  375. @@ -253,6 +260,9 @@ style choice_button_text is default:
  376.      ysize 500
  377.      yalign 0.5
  378.  
  379. +style choice_window is say_window
  380. +style choice_text is say_dialogue
  381. +
  382.  
  383.  ## Quick Menu screen ###########################################################
  384.  ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement