Code: Select all
init -100 python:
def statschangeNotify(a,f,p=False):
# a = attribute to change
# f = negative or positive value representing the change
# p = longer pause or not
# This function have no reason to be used by anything else, so keep it internal to "statschangeNotify".
def _generateText( what, who, f ):
if f < 0:
action = "deteriorated"
else:
action = "increased" if what in [ "dom", "aro", "cor", "att" ] else "improved"
# Each variables in "format" by their order. So {0} = who, {1} = action, {2} = absolute value of "f".
if what == "rel":
return "Your relationship with {0} has {1} by {2}".format( who, action, abs( f ) )
elif what == "dom":
return "Your dominance over {0} has {1} by {2}".format( who, action, abs( f ) )
elif what == "aro":
return "{0}'s arousal has {1} by {2}".format( who, action, abs( f ) )
elif what == "cor":
return "{0}'s corruption has {1} by {2}".format( who, action, abs( f ) )
elif what == "att":
return "{0}'s attitude has {1} by {2}".format( who, action, abs( f ) )
elif what == "anal":
return "{0}'s acceptance of anal sex has {1} by {2}".format( who, action, abs( f ) )
elif what == "pussy":
return "{0}'s acceptance of regular sex has {1} by {2}".format( who, action, abs( f ) )
elif what == "bj":
return "{0}'s acceptance of giving blowjobs has {1} by {2}".format( who, action, abs( f ) )
return "Oop's something really weird happen !"
# A single line for all the possible variables, as well as both positive and negative values.
if a == "mc_b":
setattr( store, a, min(getattr( store, a) + f,store.mc_b_max))
else:
setattr( store, a, getattr( store, a ) + f )
if a[:2] in [ "fM", "nK", "fS", "sN" ]:
if a[:2] in [ "fM", "fS" ]:
name = "yourshort"+a[:2]
if a[3:] in [ "aro","cor","att","anal","pussy","bj" ]:
name = "yourshortCaps"+a[:2]
else:
name = a[:2]
text = _generateText( a[3:], str( getattr( store, name ) ), f )
elif a == "mc_b":
if f < 0:
text = "Your motorcycle build decreased by {0}".format( abs( f ) )
else:
text = "Your motorcycle build increased by {0}".format( abs( f ) )
elif a == "punishment_late":
text = "You've gotten a mark for being late. Current amount is {0}. If you get more than 5 marks, you will get in trouble".format( store.punishment_late )
else:
text = "Oop's something really weird happen !"
if not "deteriorated" in text:
renpy.notify((text))
else:
renpy.notify((text,"decrease"))
if p:
renpy.pause(.6)
else:
renpy.pause(.1)
Code: Select all
window hide
renpy.pause(.6)
window auto
Code: Select all
Hide(window)
renpy.pause(.6)
Show(window)
The function is called in script.rpy like this:
Code: Select all
$ statschangeNotify("nK_aro",1.5)