Browse Source

- changed variable handling, so they are kept track of (save/load)
- improved classes

Your Name 5 years ago
parent
commit
0152f01358

+ 60 - 19
A_story_of_might_and_DEAMONtools/game/game.rpy

@@ -1,21 +1,50 @@
 label start:
-
-    show screen sideBarScreen
+    default timeObj = timeClass()
+    default map = mapClass()
+    default playerInventory = {}
+    default player = playerCharacterClass('[playerName]', '#CC66DD', 100, 100, playerInventory)
+    # default character = {}
+
+    define Mom = Character("Mom", color='#33BB33')
+    define Narrator = Character(None, color='#999999')
+
+    default sideBarImage = "profile_pants.png"
+
+    show screen sideBarScreen()
+
+    default unknownHooker = npcCharacterClass("Unknown Hooker", '#CC0066', 50, 100, 0)
+    default hostelOwner = npcCharacterClass("Slimy Joe", '#774411', 100, 100, 10)
+    default marjorie = npcCharacterClass("Marjorie", '#CC0099', 250, 100, 25)
+    default katrina = npcCharacterClass("Katrina", '#BB1177', 100, 100, 25)
+
+    python:
+        playerInventory["Pants"] = itemClass("Your lucky pants, plus they are your only pants", "lowerBody", None)
+        # character["UnknownHooker"] = npcCharacterClass("Unknown Hooker", '#CC0066', 50, 100, 0)
+        # character["HostelOwner"] = npcCharacterClass("Slimy Joe", '#774411', 100, 100, 10)
+        # character["Marjorie"] = npcCharacterClass("Marjorie", '#CC0099', 250, 100, 25)
+        # character["Katrina"] = npcCharacterClass("Katrina", '#BB1177', 100, 100, 25)
+
+    default Player = wrapCharacter(player)
+    default UnknownHooker = wrapCharacter(unknownHooker)
+    # default UnknownHooker = wrapCharacter(character["UnknownHooker"])
+    default HostelOwner = wrapCharacter(hostelOwner)
+    default Marjorie = wrapCharacter(marjorie)
+    default Katrina = wrapCharacter(katrina)
 
     jump intro
 
-label dailyRoutine: #pun intended
-
-    menu:
-        "Do you want to stay here or go somewhere else?"
 
-        "Stay here.":
-            $ renpy.jump(player.location)
-
-        "Leave and go somewhere else.":
-            call screen mapScreen()
-
-    jump dailyRoutine
+# label dailyRoutine: #pun intended
+#
+#     menu:
+#         "Do you want to stay here or go somewhere else?"
+#
+#         "Stay here.":
+#             $ renpy.jump(player.location)
+#
+#         "Leave and go somewhere else.":
+#
+#     jump dailyRoutine
 
 label downtownRedlight:
 
@@ -30,8 +59,11 @@ label downtownRedlight:
         "Go to the hostel":
             jump hostel
 
-        "Leave for now.":
-            jump dailyRoutine
+        "Go somehere else":
+            call screen mapScreen()
+
+        # "Leave for now.":
+        #     jump dailyRoutine
 
 label hostel:
 
@@ -46,8 +78,8 @@ label hostel:
         "Go to your room":
             jump hostelroom
 
-        "Stay here":
-            jump hostel
+        "Go somehere else":
+            call screen mapScreen()
 
 label hostelroom:
 
@@ -55,7 +87,7 @@ label hostelroom:
 
     menu:
         "Sleep.":
-            $ sleep(player, 480)
+            $ player.sleep(480)
             jump hostelroom
 
         "Leave.":
@@ -63,7 +95,16 @@ label hostelroom:
 
 label brothel:
 
-    jump downtownRedlight
+    scene brothel_katrina
+
+    menu:
+        "What do you want to do?"
+
+        "Go to the redlight district":
+            jump downtownRedlight
+
+        "Go somehere else":
+            call screen mapScreen()
 
 label mapScreen:
 

+ 6 - 6
A_story_of_might_and_DEAMONtools/game/intro.rpy

@@ -31,8 +31,8 @@ label intro:
             Narrator "You heed your moms advice and head for the road to the industrial area."
 
         "Debug exit":
-            $ player.location = mapObj.downtownRedlight.name
-            $ mapObj.downtownRedlight.known = true
+            $ player.location = map.downtownRedlight.name
+            $ map.downtownRedlight.known = true
             $ renpy.jump(player.location)
 
     Narrator "You never been there after dawn, but you overheard some kids in school gossiping about the hookers standing there at night."
@@ -236,7 +236,7 @@ label intro:
     menu:
 
         "Go to sleep":
-            $ sleep(player, 600)
+            $ player.sleep(600)
 
     Narrator "The next morning you wake up after a long nights sleep and need a couple of seconds to remember how you got here. What a strange night."
     Narrator "You somehow feel badly rested and weak, far from the healthy and invigorated sensation you had yesterday after the blowjob."
@@ -330,11 +330,11 @@ label intro:
 
     $ timeObj.passTime(45)
 
-    $ mapObj.downtownRedlight.known = true
+    $ map.downtownRedlight.known = true
 
     menu:
 
-        "Go to the Streetwalkers behind the downtown trainstation." if (mapObj.downtownRedlight.known != None):
+        "Go to the Streetwalkers behind the downtown trainstation." if (map.downtownRedlight.known != None):
             "You leave the youth hostel and head back towards the central train station."
 
     scene downtown_redlight
@@ -435,7 +435,7 @@ label intro:
     Katrina "Good luck out there."
     Narrator "And with that you leave the brothel and are on your own."
 
-    $ player.location = mapObj.downtownRedlight.name
+    $ player.location = map.downtownRedlight.name
     $ timeObj.passTime(60)
 
     $ renpy.jump(player.location)

+ 1 - 1
A_story_of_might_and_DEAMONtools/game/options.rpy

@@ -12,7 +12,7 @@
 ##
 ## The _() surrounding the string marks it as eligible for translation.
 
-define config.name = _("SUCer")
+define config.name = _("A_story_of_might_and_DEAMONtools")
 
 
 ## Determines if the title given above is shown on the main menu screen. Set

+ 43 - 54
A_story_of_might_and_DEAMONtools/game/script.rpy

@@ -3,10 +3,10 @@
 # Declare characters used by this game. The color argument colorizes the
 # name of the character.
 
+define true = "true" # or whatever != None for easier coding and better readability
 init:
-    $ true = "true" # or whatever != None for easier coding and better readability
     $ player = None
-    $ timeObj = None
+# default timeObj = None
 
 init python:
 
@@ -27,7 +27,7 @@ init python:
                     self.dayChange()
 
         def dayChange(self):
-            loseMight(player, 10)
+            player.loseMight(10)
             #rent calculation and all the other stuff
 
         def getMinute(self):
@@ -94,6 +94,17 @@ init python:
         def getCurAP(self):
             return self.curHP
 
+        def hurt(self, amount):
+            self.curHP -= amount
+            if (self.curHP <= 0):
+                self.curHP = 0
+            return self.curHP # because somehow it is beyond me how to access it from child
+
+        def heal(self, amount):
+            self.curHP += amount
+            if (self.curHP > self.maxHP):
+                self.curHP = self.maxHP
+
     class npcCharacterClass(characterClass):
         def __init__(self, name, color, maxHP, maxAP, disposition):
             characterClass.__init__(self, name, color, maxHP, maxAP)
@@ -115,6 +126,21 @@ init python:
             self.money = 0
             self.heat = 0 # how much suspicion is going around that there is an unknown daemon in the district
 
+        def hurt(self, amount):
+            if (super(playerCharacterClass, self).hurt(amount) == 0):
+                    renpy.jump('gameover')
+
+        def sleep(self, time):
+            self.curAP = self.maxAP
+            self.heal((self.maxHP/20))
+            timeObj.passTime(time)
+
+        def loseMight(self, amount):
+            self.might -= amount
+            if (self.might <= 0):
+                self.might = 0
+                self.hurt(self.maxHP/5)
+
     def wrapCharacter(char):
         return Character(char.name, color=char.color)
 
@@ -126,56 +152,6 @@ init python:
             char.skills.bj += 10
             char.money += payment
             timeObj.passTime(10)
-
-    def sleep(char, time):
-        char.curAP = char.maxAP
-        heal(char,(char.maxHP/20))
-        timeObj.passTime(time)
-
-    def hurt(char, amount):
-        char.curHP -= amount
-        if (char.curHP <= 0):
-            char.curHP = 0
-            if (char == player):
-                renpy.jump('gameover')
-
-    def heal(char, amount):
-        char.curHP += amount
-        if (char.curHP > char.maxHP):
-            char.curHP = char.maxHP
-
-    def loseMight(char, amount):
-        char.might -= amount
-        if (char.might <= 0):
-            char.might = 0
-            if (char == player):
-                hurt(player, player.maxHP/5)
-
-init:
-
-    python:
-        timeObj = timeClass()
-        mapObj = mapClass()
-        playerInventory = {} # dummy
-        playerInventory["Pants"] = itemClass("Your lucky pants, plus they are your only pants", "lowerBody", None)
-        player = playerCharacterClass('[playerName]', '#CC66DD', 100, 100, playerInventory)
-        character = {}
-        character["UnknownHooker"] = npcCharacterClass("Unknown Hooker", '#CC0066', 50, 100, 0)
-        character["HostelOwner"] = npcCharacterClass("Slimy Joe", '#774411', 100, 100, 10)
-        character["Marjorie"] = npcCharacterClass("Marjorie", '#CC0099', 250, 100, 25)
-        character["Katrina"] = npcCharacterClass("Katrina", '#BB1177', 100, 100, 25)
-
-    $ Player = wrapCharacter(player)
-    $ UnknownHooker = wrapCharacter(character["UnknownHooker"])
-    $ HostelOwner = wrapCharacter(character["HostelOwner"])
-    $ Marjorie = wrapCharacter(character["Marjorie"])
-    $ Katrina = wrapCharacter(character["Katrina"])
-
-    $ Mom = Character("Mom", color='#33BB33')
-    $ Narrator = Character(None, color='#999999')
-
-    $ sideBarImage = "profile_pants.png"
-
 screen sideBarScreen():
 
     # image eileen composite = Composite(
@@ -220,4 +196,17 @@ screen mapScreen():
 
     add "citymap.jpg"
 
-    imagebutton idle "redlight_button.jpg" xpos 830 ypos 560 action Function(renpy.jump, label='downtownRedlight') # 200,113
+    imagebutton idle "redlight_button.jpg" xpos 830 ypos 560 action Show("redlighMenuScreen") #action Function(renpy.jump, label='downtownRedlight') # 200,113
+
+screen redlighMenuScreen():
+    modal True
+    default x = renpy.get_mouse_pos()[0]
+    default y = renpy.get_mouse_pos()[1]
+
+    frame:
+        pos (x + 10, y + 20)
+        has vbox
+        textbutton "Redlight district":
+            action Hide("redlighMenuScreen"), Function(renpy.jump, label='downtownRedlight')
+        textbutton "Brothel":
+            action Hide("redlighMenuScreen"), Function(renpy.jump, label='brothel')

+ 1 - 1
README.md

@@ -1,3 +1,3 @@
 imagepack separate from mega.nz link:
 
-https://mega.nz/fm/3KpVRAjT
+https://mega.nz/#F!CL4HQZ6a