Skip to content

Commit

Permalink
Adjusted credits to be slightly more challenging. Improved money disp…
Browse files Browse the repository at this point in the history
…lay. Fixed a bug where the wrong parenting style was used. Better device compatibility. Renpy 8.0.2 build
  • Loading branch information
qirien committed Sep 1, 2022
1 parent 817b8e3 commit 89210a3
Show file tree
Hide file tree
Showing 26 changed files with 72 additions and 69 deletions.
5 changes: 5 additions & 0 deletions game/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.exclude": {
"**/*.rpyc": true
}
}
4 changes: 2 additions & 2 deletions game/community.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -6196,8 +6196,8 @@ label luxury_good:
"I'd go pick up the kids in the morning, and then I'd drop them off at the co-op daycare after lunch."
"At first it was really difficult. The kids had a hard time changing their routines."
"I had forgotten how hard it is to do anything with kids in the house, so often I'd still be working on my farm after dinner."
$ modify_credits(2000)
"I did make a lot of money though!" #+2000/200 credits but more stress?
$ modify_credits(1200)
"I did make a lot of money though!" #+1200/200 credits but more stress?
"Consult on small farming projects.":
"I advertised my professional farm consulting in the {i}Talaam Times{/i}."
"I was surprised when Oleg was my first customer."
Expand Down
Binary file modified game/community.rpyc
Binary file not shown.
2 changes: 1 addition & 1 deletion game/crop-events.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ label spinach2_pick_early:
him annoyed "This is something that I cannot forgive."
him angry "This means war!"
"My nights were filled with killing turtle-snails."
"They appeared in my dreams, giant, house-sized turtle-snails with ever-chewing mouths, the entire earth disappearing beneath their slavering jaws until Talaam was just an empty spot in the vast blackness of space."
"They appeared in my dreams: house-sized turtle-snails with ever-chewing mouths, the entire planet disappearing beneath their slavering jaws until Talaam was an empty spot in the vast blackness of space."
"I started seeing them everywhere I looked -- in the fields, in the barn, in the outhouse."
"I trapped and tossed and stamped and squished, but the next night there were still more. For a week I barely slept trying to kill them all."
"Finally, their numbers were greatly reduced, and I could rest. Until the next invasion..."
Expand Down
Binary file modified game/crop-events.rpyc
Binary file not shown.
4 changes: 2 additions & 2 deletions game/defines.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ init -100:

# Money data
define KELLY_SALARY = 2000
define CALORIES_TO_MONEY_MULTIPLIER = 14
define CALORIES_TO_MONEY_MULTIPLIER = 25 #represents how much more it costs to feed kids. As their calories increase, expenses also increase
define MONEY_YEAR = 6
define KID_WORK_YEAR = 7
define NUTRITION_YEAR = 10

# GUI display sizes
define CROP_ICON_SIZE = 64
define CROP_LAYOUT_BAR_SIZE = CROP_ICON_SIZE + 8
define CROP_LAYOUT_BAR_WIDTH = CROP_ICON_SIZE / 10
define CROP_LAYOUT_BAR_WIDTH = int(CROP_ICON_SIZE / 10)
define CROP_STATUS_ICON_SIZE = 32

# Static variables used for endings
Expand Down
Binary file modified game/defines.rpyc
Binary file not shown.
6 changes: 4 additions & 2 deletions game/family.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -6174,11 +6174,13 @@ label family20:
him doubt "What happened to a 'personal instructor'?"
ilian happy "If you're paying less, you get less. That's how the world works."
him pout "All right, fine."
$ modify_credits(-20*28)
"20 credits per week for the rest of the year... that was not cheap."
$ modify_credits(-20*14)
"You have a deal.":
him normal "You have a deal. It's not like you have any competition in the instrument teaching business."
ilian happy "I'm glad you realize the value of the musical arts."
$ modify_credits(-25*28)
"25 credits per week for the rest of the year... that was not cheap."
$ modify_credits(-25*14)
"Isn't there something else we could exchange?" if get_extra_work():
him concerned "Isn't there something else we could exchange?"
ilian angry "You don't have anything I want."
Expand Down
Binary file modified game/family.rpyc
Binary file not shown.
30 changes: 7 additions & 23 deletions game/functions.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,11 @@ init -100 python:
def modify_credits(amount, show_notification=True):
global credits, notifications
amount = roundint(amount)
if show_notification:
credit_msg = "{image=" + STAT_ICON_BASE + "value.png} " + str(amount)
notify_change(credit_msg)
credits += amount
if (year > MONEY_YEAR): # only if credits are used yet
if show_notification:
credit_msg = "{image=" + STAT_ICON_BASE + "value.png} " + str(amount)
notify_change(credit_msg)
credits += amount
return

def modify_farm_size(amount):
Expand Down Expand Up @@ -419,9 +420,9 @@ init -100 python:

def get_calories_kid(age):
if (0 <= age < BABY_MAX):
return 4
return 2
if (BABY_MAX <= age < TODDLER_MAX):
return 9
return 5
if (TODDLER_MAX <= age < CHILD_MAX):
return 14
if (CHILD_MAX <= age < YTEEN_MAX):
Expand Down Expand Up @@ -600,23 +601,6 @@ init -100 python:
def roundint(number):
return int(round(number))

# Sorting functions (Python 2.7)
# For Python 3+, only return the value on which to sort.
def sortby_calories(val1, val2):
return val1[CALORIES_INDEX] - val2[CALORIES_INDEX]
def sortby_vita(val1, val2):
return val1[VITA_INDEX] - val2[VITA_INDEX]
def sortby_vitc(val1, val2):
return val1[VITC_INDEX] - val2[VITC_INDEX]
def sortby_vitm(val1, val2):
return val1[VITM_INDEX] - val2[VITM_INDEX]
def sortby_work(val2, val1):
return val1[WORK_INDEX] - val2[WORK_INDEX]
def sortby_nitrogen(val1, val2):
return val2[NITROGEN_INDEX] - val1[NITROGEN_INDEX]
def sortby_value(val1, val2):
return val1[VALUE_INDEX] - val2[VALUE_INDEX]

def achieved(a_name):
if (achievement.has(a_name)):
return
Expand Down
Binary file modified game/functions.rpyc
Binary file not shown.
Binary file modified game/gui.rpyc
Binary file not shown.
3 changes: 2 additions & 1 deletion game/options.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
define config.name = _("Space to Grow")

## The version of the game.
define config.version = "1.4"
define config.version = "2.0"
# Uncomment if you want the cheat/developer console enabled.
#define config.console = True

Expand All @@ -26,6 +26,7 @@ define config.autosave_on_choice = False
define config.autosave_on_quit = True

define config.load_failed_label = "life_loop" #If it can't find where to return to, just replay the current year.
define config.allow_underfull_grids = True # let our vpgrids not be full

## Text that is placed on the game's about screen. To insert a blank line
## between paragraphs, write \n\n.
Expand Down
Binary file modified game/options.rpyc
Binary file not shown.
49 changes: 28 additions & 21 deletions game/screen-farm.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ screen plan_farm():

# To change appearance, see screens.rpy, screen nvl
label yearly_messages:
$ message = "message" + `year`
$ year_string = repr(year)
$ message = "message" + year_string
$ read_messages = True
nvl clear
call expression message from _call_expression_4
Expand Down Expand Up @@ -237,26 +238,26 @@ screen choose_crop(crop_index=0):

# Buttons to sort by different stats
hbox:
spacing 15
spacing 10
textbutton "Sort By" xalign 0.0 style "plan_farm_button" action ToggleScreenVariable("show_sort")

showif show_sort:
hbox:
at popside
use sort_buttons

$ crop_columns = count_enabled_crops()//4 + 2 #more columns with more enabled crops
# Available crops to choose from
vpgrid:
cols (count_enabled_crops()//4 + 2) #more columns with more enabled crops
cols crop_columns
spacing 10
side_xalign 0.5

# Sort by proper key
$ sortwith = "sortby_" + sortby
# Sort by proper key
if (sortby == "name"):
$ crops_to_show = sorted(crop_info)
else:
$ crops_to_show = sorted(crop_info, eval(sortwith), reverse=True)
$ crops_to_show = sorted(crop_info,key= lambda x: x[eval(sortby.upper() + "_INDEX")], reverse=True)
for j in range(0, len(crop_info)):
# only show currently enabled crops where we haven't planted the maximum yet
if (crops_to_show[j][ENABLED_INDEX] and (crops_to_show[j][MAXIMUM_INDEX] > 0) and
Expand All @@ -266,10 +267,10 @@ screen choose_crop(crop_index=0):
$ imagefile = get_crop_filename(crop_name)
$ is_selected = (selected_crop_index == crop_info_index)
imagebutton:
idle Composite((CROP_ICON_SIZE,CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE/2,0), get_boosted_image(crop_name, crop_index))
hover Composite((CROP_ICON_SIZE,CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE/2,0), get_boosted_image(crop_name, crop_index), (0,0), "gui/crop icons/selected.png")
selected_idle Composite((CROP_ICON_SIZE,CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE/2,0), get_boosted_image(crop_name, crop_index), (0,0), "gui/crop icons/selected.png")
insensitive Composite((CROP_ICON_SIZE, CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE/2,0), get_boosted_image(crop_name, crop_index), (0,0), Solid(gray_transparent))
idle Composite((CROP_ICON_SIZE,CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE//2,0), get_boosted_image(crop_name, crop_index))
hover Composite((CROP_ICON_SIZE,CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE//2,0), get_boosted_image(crop_name, crop_index), (0,0), "gui/crop icons/selected.png")
selected_idle Composite((CROP_ICON_SIZE,CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE//2,0), get_boosted_image(crop_name, crop_index), (0,0), "gui/crop icons/selected.png")
insensitive Composite((CROP_ICON_SIZE, CROP_ICON_SIZE), (0,0), imagefile, (CROP_ICON_SIZE//2,0), get_boosted_image(crop_name, crop_index), (0,0), Solid(gray_transparent))
xysize (CROP_ICON_SIZE,CROP_ICON_SIZE)
focus_mask None
anchor (0.5, 0.5)
Expand Down Expand Up @@ -324,11 +325,11 @@ screen stat_icons(stat_value, stat_index):
# must be a nitrogen-giving thing
if (stat_value < 0):
$ stat_icon_name = "nitrogen-add"
$ stat_value = -stat_value/2
$ stat_value = -stat_value//2
else:
$ stat_icon_name = CROP_INFO_INDEX_NAMES[stat_index].lower()

for i in range(0, stat_value//2):
for i in range(0, int(stat_value//2)):
add STAT_ICON_BASE + stat_icon_name + ".png"
if (stat_value%2 > 0):
add STAT_ICON_BASE + stat_icon_name + "-half.png"
Expand Down Expand Up @@ -401,11 +402,11 @@ screen crops_layout():
alt current_crop_name + alt_add
idle Composite((CROP_ICON_SIZE,CROP_ICON_SIZE),
(0,0), imagefile,
(CROP_ICON_SIZE/2,0), get_boost_image(i),
(CROP_ICON_SIZE//2,0), get_boost_image(i),
(0,0), "gui/crop icons/idle.png")
hover Composite((CROP_ICON_SIZE,CROP_ICON_SIZE),
(0,0), imagefile,
(CROP_ICON_SIZE/2,0), get_boost_image(i),
(CROP_ICON_SIZE//2,0), get_boost_image(i),
(0,0), "gui/crop icons/selected.png")
xysize (CROP_ICON_SIZE,CROP_ICON_SIZE)
anchor (0.5, 0.5)
Expand Down Expand Up @@ -514,25 +515,31 @@ screen crops_totals():
if (crop_enabled("wheat")):
$ total_expenses += WHEAT_COST
hbox:
text "Value "
text "Finances "
use stat_icons(2, VALUE_INDEX)
hbox:
style_prefix "plan_farm_total"
xfill True
vbox:
text "Current Balance"
text "Value"
text "Expenses"
text "Projected Change"
#text "Value"
#text "Expenses"
text "{font=fonts/OpenSansEmoji.otf}_____________________{/font}"
text "Expected Balance"
vbox:
xalign 1.0
text str(credits) xalign 1.0
if (total_expenses > total_value):
text "+" + str(total_value) color red_med xalign 1.0
$ year_net = total_value - total_expenses
if (year_net < 0):
text str(year_net) color red_med xalign 1.0
else:
text "+" + str(total_value) xalign 1.0
text "-" + str(total_expenses) xalign 1.0
text "+" + str(year_net) xalign 1.0
#if (total_expenses > total_value):
# text "+" + str(total_value) color red_med xalign 1.0
#else:
# text "+" + str(total_value) xalign 1.0
#text "-" + str(total_expenses) xalign 1.0
text "{font=fonts/OpenSansEmoji.otf}_____{/font}" xalign 1.0
text str(credits + total_value - total_expenses) xalign 1.0

Expand Down
Binary file modified game/screen-farm.rpyc
Binary file not shown.
10 changes: 6 additions & 4 deletions game/screen-handbook.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ screen parenting_handbook():
null width 30
vbox:
xsize LEFT_COLUMN_WIDTH-50
ysize 400
textbutton "General" selected (show_year < 0) action SetVariable("show_year", -1)
textbutton "Baby (0-1)" selected (0 <= show_year <= BABY_MAX) action SetVariable("show_year", BABY_MAX)
showif (year > BABY_MAX):
Expand All @@ -43,6 +42,8 @@ screen parenting_handbook():
textbutton "Older Teen (16-18)" selected (YTEEN_MAX < show_year) action SetVariable("show_year", MAX_YEARS)
null width 5
vbox:
yalign 0.0
ysize 480
xsize MIDDLE_COLUMN_WIDTH-32
use kid_info

Expand All @@ -65,11 +66,11 @@ screen kid_info():

screen general_info():
tag kid_info
text childs_mind["general"] yalign 0.0
text childs_mind["general"]

screen baby_info():
tag kid_info
text childs_mind["baby"]
text childs_mind["baby"]

screen toddler_info():
tag kid_info
Expand Down Expand Up @@ -99,7 +100,8 @@ style parenting_frame is computer_sub_frame:
xsize MIDDLE_COLUMN_WIDTH + LEFT_COLUMN_WIDTH + 48
style parenting_label is computer_sub_label
style parenting_label_text is computer_sub_label_text
style parenting_text is computer_sub_text
style parenting_text is computer_sub_text:
yalign 0.0
style parenting_vbox is computer_sub_vbox
style parenting_hbox is computer_sub_hbox

Expand Down
Binary file modified game/screen-handbook.rpyc
Binary file not shown.
15 changes: 8 additions & 7 deletions game/screens.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -842,13 +842,14 @@ screen preferences():
textbutton _("Left") action Preference("rollback side", "left") tooltip "Clicking on the left side of the screen will roll back text"
textbutton _("Right") action Preference("rollback side", "right") tooltip "Clicking on the right side of the screen will roll back text"

vbox:
style_prefix "check"
label _("Skip")
if (config.developer):
textbutton _("Unseen Text") action Preference("skip", "toggle") tooltip "Skip text even if you haven't seen it before"
textbutton _("After Choices") action Preference("after choices", "toggle") tooltip "After a choice is made, continue skipping"
textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle")) tooltip "Disable transitions while skipping"
showif persistent.times_beaten:
vbox:
style_prefix "check"
label _("Skip")
if (config.developer):
textbutton _("Unseen Text") action Preference("skip", "toggle") tooltip "Skip text even if you haven't seen it before"
textbutton _("After Choices") action Preference("after choices", "toggle") tooltip "After a choice is made, continue skipping"
textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle")) tooltip "Disable transitions while skipping"

vbox:
style_prefix "radio"
Expand Down
Binary file modified game/screens.rpyc
Binary file not shown.
7 changes: 4 additions & 3 deletions game/script.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ label start:
# Yield of most recent set of crops, in percentages
default credits = 0
default years_yield = [100] * farm_size
default annual_expenses_base = 2550
default annual_expenses_base = 2600
default debt_consecutive_years = 0
default debt_event_count = 0
default seen_miners_debt = False
Expand All @@ -209,7 +209,7 @@ label start:
["potatoes", 10, 0, 6, 2, 6, 6, 40, True, False, False, 100],
["wheat", 10, 5, 5, 6, 9, 9, 20, False, False, False, 2],
["peppers", 2, 2, 9, 0, 5, 5, 25, False, False, True, 100], # "Fruits"
["tomatoes", 3, 3, 4, 2, 8, 6, 15, True, False, True, 100],
["tomatoes", 3, 3, 4, 2, 7, 6, 15, True, False, True, 100],
["plums", 3, 1, 1, 1, 6, 7, 15, False, True, True, 1],
["plums+", 3, 1, 1, 1, 6, 2, 0, False, True, True, 0], # Perennials are easier after year 1, but can't be moved
["squash", 4, 8, 3, 2, 2, 4, 15, True, False, True, 100],
Expand Down Expand Up @@ -405,6 +405,7 @@ label life_loop:

# TUTORIALS FOR NEW STUFF
if (year == MONEY_YEAR):
$ credits = 0
"I now earn credits for the crops I choose, after deductions for expenses."
scene tutorial-credits with fade
"This part of the screen shows how much I'll earn and how much my expenses are."
Expand Down Expand Up @@ -540,7 +541,7 @@ label life_loop:
show text "End Young Teen Years"
$ renpy.pause(1.5)
show yteen_cg
alt "[his_name] looks on with nervous laughter while [kid_name] drives the tractor."
alt "image: [his_name] looks on with nervous laughter while [kid_name] drives the tractor."
$ renpy.pause(6.0)
$ renpy.pause()

Expand Down
Binary file modified game/script.rpyc
Binary file not shown.
2 changes: 1 addition & 1 deletion game/test.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ label test_message_board:
$ i = 1
while (i <= MAX_YEARS):
call interscene_text(i, "Message Board") from _call_interscene_text_6
$ message = "message" + `i`
$ message = "message" + repr(i)
call expression message from _call_expression_5
$ i += 1
return
Expand Down
Binary file modified game/test.rpyc
Binary file not shown.
4 changes: 2 additions & 2 deletions game/work.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -1397,8 +1397,8 @@ label work20:
him surprised "WATER, as in 'We oughtta'? W'otta? You don't think it works?"
thuc normal "Nope, sorry. It... SINKS."
show him laugh with dissolve
"We managed to keep most of our crops from dying, but they probably wouldn't yield as much this year."
$ modify_credits(-100)
"We managed to keep most of our crops from dying, but they definitely didn't yield as much."
$ modify_credits(farm.income_loss(80))
return

# Year 22, 13.6 years old
Expand Down
Binary file modified game/work.rpyc
Binary file not shown.

0 comments on commit 89210a3

Please sign in to comment.