This task is to determine the difference between two attributes, strength and skill, from game characters. The process for this is:
- Determining the difference between the strength attributes.
- The difference is divided by five and rounded down to create a ‘strength modifier’.
- The same process is carried out for the skill attribute and named ‘skill modifier’.
- Then the game begins:
- Both players throw a six sided die.
- If the values are the same, no changes happen.
- If the values are different, the player with the highest value then gains the strength and skill worked out earlier and it is then added to their total. The player who has the lowest value has the strength and skill worked out taken away from their total.
This must repeat until the strength attribute is equal or below 0, however, this part I cant do, I know how to loop but this is always done by asking the user if they wish to go again.
c1sc=random.randint(1,6)
c2sc=random.randint(1,6)
if c1sc > c2sc:c1st=c1st+strengthmodifierc2st=c2st-strengthmodifierc1sk=c1sk+skillmodifierc2sk=c2sk-skillmodifierprint('Character 1, your strength attribute is: '+(str(c1st))+' and your skill attribute is: '+(str(c1sk)))print('Character 2, your strength attribute is: '+(str(c2st))+' and your skill attribute is: '+(str(c2sk)))
elif c2sc > c1sc:c1st=c1st-strengthmodifierc2st=c2st+strengthmodifierc1sk=c1sk-skillmodifierc2sk=c2sk+skillmodifierprint('Character 1, your strength attribute is: '+(str(c1st))+' and your skill attribute is: '+(str(c1sk)))print('Character 2, your strength attribute is: '+(str(c2st))+' and your skill attribute is: '+(str(c2sk)))
else:print('It\'s a draw, no changes were made.')
if c1sk < 0:c1sk=0
elif c2sk < 0:c2sk=0if c1st < 0:print('Character 1 died. Game over.')
elif c2st < 0:print('Character 2 died. Game over.')
Please help!