# +----------------------------------
# | Attack Damage
# +----------------------------------
Fight_Attack:
type: task
Script:
# Check if the player attempted to Dodge
- if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
- define random <util.random.int[1].to[100]> - 20
- flag player Fight_Dodged:!
# Check if the player attempted to Block
} else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
- define random <util.random.int[1].to[100]> - 20
- flag player Fight_Blocked:!
} else {
# Check if the player didn't attempt to dodge or block, roll with full range
- define random <util.random.int[1].to[100]>
}
- narrate "rolled %random%"
# Checking the random number, to determine the amount of damage it will hit for.
- - if %random% =< 20 {
- - run Fight_Attack_0
+ - if %random% =< 20 {
+ - run Fight_Attack_0
+ }
+
+ else if %random% > 20 && %random% =< 40 {
+ - run Fight_Attack_1
+ }
- } else {
- - if %random% > 20 && %random% =< 40 {
- - run Fight_Attack_1
+ else if %random% > 40 && %random% =< 60 {
+ - run Fight_Attack_2
+ }
- } else {
- - if %random% > 40 && %random% =< 60 {
- - run Fight_Attack_2
+ else if %random% > 60 && %random% =< 80 {
+ - run Fight_Attack_3
+ }
- } else {
- - if %random% > 60 && %random% =< 80 {
- - run Fight_Attack_3
+ else if %random% > 80 && %random% =< 100 {
+ - run Fight_Attack_4
+ }
- } else {
- - if %random% > 80 && %random% =< 100 {
- - run Fight_Attack_4
+ else {
+ - narrate "<Dark_Red>RANDOM NUMBER TO DETERMINE ATTACK DAMAGE FAILED!!!!!!!!!!!"
+ }
- } else {
- - narrate "<Dark_Red>RANDOM NUMBER TO DETERMINE ATTACK DAMAGE FAILED!!!!!!!!!!!"
- }