Hey guys,
So me and my friend are starting up a simple Text-Based-Post-Apocalyptic-Role-Playing-Game.
Both of us have had 2 or so months of experience, we are no experts.
So, I will appreciate any tips.
I have been lurking these forums for a little while now, and decieded this is the best place for answers.
I will split my question into 2 parts.
RUNNING PYTHON 2.7
Part 1:
An example of our statclass:
Scavenger={'st':3, 'dex':5, 'luck':12, 'intel':1}
statclass=Scavenger
item_wornboots=['Worn Boots', statclass['luck'] + 0.5]
print statclass
Is there a way of permanently changing the value of 'luck' when the boots would be applied?
So that the luck becomes 12.5?
Part 2:
We want to be able to let the user be able to type 'i' at anytime to print their inventory which would be kept in a separate .txt file.
Is there a function that could be placed at the beginning of the main script to allow them to do so without having to have an 'if' statement EVERYWHERE?
Example:
#The somethingrather up here.
tq=raw_input ("Welcome to Town Square. ")
if tq==('n'):
"""Movement to new scene"""
elif tq==('e'):
"""Movement to new scene"""
elif tq==('s'):
"""Movement to new scene"""
elif tq==('w'):
"""Movement to new scene"""
#I would like not to put another 'elif' statement here just to check inventory
#And, so they can check iventory ANYWHERE