# kickboxing_funcs if $ARGS[0] = 'init_fight_vars': temp_kickboxVars['pcs_points'] = 0 temp_kickboxVars['npc_points'] = 0 temp_kickboxVars['round'] = 1 temp_kickboxVars['time'] = 0 temp_kickboxVars['max_rounds'] = 3 end if $ARGS[0] = 'generate_opponent': if $ARGS[1] = 'spar': gs 'npcgeneratec', 1, 'sparring partner', rand(19, 45) gs 'boyStat', $npclastgenerated temp_kickboxVars['npc_stren'] = rand(10, 20) temp_kickboxVars['npc_speed'] = rand(10, 20) temp_kickboxVars['npc_agil'] = rand(10, 20) temp_kickboxVars['npc_react'] = rand(10, 20) temp_kickboxVars['npc_vital'] = rand(10, 20) temp_kickboxVars['npc_intel'] = 10 temp_kickboxVars['npc_will'] = 10 !!skills temp_kickboxVars['npc_jab'] = rand(5, 20) temp_kickboxVars['npc_punch'] = rand(5, 20) temp_kickboxVars['npc_kick'] = rand(5, 20) temp_kickboxVars['npc_def'] = rand(5, 20) !!parameters elseif $ARGS[1] = 'amateur_fight': if ARGS[2] <= 0: gs 'npcgeneratec', 1, 'Useless rival', rand(19,45) gs 'boyStat', $npclastgenerated temp_kickboxVars['npc_stren'] = rand(10, 20) temp_kickboxVars['npc_speed'] = rand(10, 20) temp_kickboxVars['npc_agil'] = rand(10, 20) temp_kickboxVars['npc_react'] = rand(10, 20) temp_kickboxVars['npc_vital'] = rand(10, 20) temp_kickboxVars['npc_intel'] = 10 temp_kickboxVars['npc_will'] = 10 !!skills temp_kickboxVars['npc_jab'] = rand(10, 30) temp_kickboxVars['npc_punch'] = rand(10, 30) temp_kickboxVars['npc_kick'] = rand(10, 30) temp_kickboxVars['npc_def'] = rand(10, 30) elseif ARGS[2] = 1: gs 'npcgeneratec', 1, '3rd class rival', rand(19,45) gs 'boyStat', $npclastgenerated temp_kickboxVars['npc_stren'] = rand(15, 25) temp_kickboxVars['npc_speed'] = rand(15, 25) temp_kickboxVars['npc_agil'] = rand(15, 25) temp_kickboxVars['npc_react'] = rand(15, 25) temp_kickboxVars['npc_vital'] = rand(15, 25) temp_kickboxVars['npc_intel'] = 10 temp_kickboxVars['npc_will'] = 10 !!skills temp_kickboxVars['npc_jab'] = rand(15, 35) temp_kickboxVars['npc_punch'] = rand(15, 35) temp_kickboxVars['npc_kick'] = rand(15, 35) temp_kickboxVars['npc_def'] = rand(15, 35) elseif ARGS[2] = 2: gs 'npcgeneratec', 1, '2rd class rival', rand(19,45) gs 'boyStat', $npclastgenerated temp_kickboxVars['npc_stren'] = rand(20, 30) temp_kickboxVars['npc_speed'] = rand(20, 30) temp_kickboxVars['npc_agil'] = rand(20, 30) temp_kickboxVars['npc_react'] = rand(20, 30) temp_kickboxVars['npc_vital'] = rand(20, 30) temp_kickboxVars['npc_intel'] = 10 temp_kickboxVars['npc_will'] = 10 !!skills temp_kickboxVars['npc_jab'] = rand(30, 50) temp_kickboxVars['npc_punch'] = rand(30, 50) temp_kickboxVars['npc_kick'] = rand(30, 50) temp_kickboxVars['npc_def'] = rand(30, 50) elseif ARGS[2] = 3: gs 'npcgeneratec', 1, '1st class rival', rand(19,45) gs 'boyStat', $npclastgenerated temp_kickboxVars['npc_stren'] = rand(30, 40) temp_kickboxVars['npc_speed'] = rand(30, 40) temp_kickboxVars['npc_agil'] = rand(30, 40) temp_kickboxVars['npc_react'] = rand(30, 40) temp_kickboxVars['npc_vital'] = rand(30, 40) temp_kickboxVars['npc_intel'] = 10 temp_kickboxVars['npc_will'] = 10 !!skills temp_kickboxVars['npc_jab'] = rand(40, 60) temp_kickboxVars['npc_punch'] = rand(40, 60) temp_kickboxVars['npc_kick'] = rand(40, 60) temp_kickboxVars['npc_def'] = rand(40, 60) elseif ARGS[2] = 4: gs 'npcgeneratec', 1, 'Excellent rival', rand(19,45) gs 'boyStat', $npclastgenerated temp_kickboxVars['npc_stren'] = rand(40, 60) temp_kickboxVars['npc_speed'] = rand(40, 60) temp_kickboxVars['npc_agil'] = rand(40, 60) temp_kickboxVars['npc_react'] = rand(40, 60) temp_kickboxVars['npc_vital'] = rand(40, 60) temp_kickboxVars['npc_intel'] = 10 temp_kickboxVars['npc_will'] = 10 !!skills temp_kickboxVars['npc_jab'] = rand(60, 80) temp_kickboxVars['npc_punch'] = rand(60, 80) temp_kickboxVars['npc_kick'] = rand(60, 80) temp_kickboxVars['npc_def'] = rand(60, 80) else gs 'npcgeneratec', 1, 'Best rival in the gym', rand(19,45) gs 'boyStat', $npclastgenerated temp_kickboxVars['npc_stren'] = rand(60, 100) temp_kickboxVars['npc_speed'] = rand(60, 100) temp_kickboxVars['npc_agil'] = rand(60, 100) temp_kickboxVars['npc_react'] = rand(60, 100) temp_kickboxVars['npc_vital'] = rand(60, 100) temp_kickboxVars['npc_intel'] = 10 temp_kickboxVars['npc_will'] = 10 !!skills temp_kickboxVars['npc_jab'] = rand(80, 110) temp_kickboxVars['npc_punch'] = rand(80, 110) temp_kickboxVars['npc_kick'] = rand(80, 110) temp_kickboxVars['npc_def'] = rand(80, 110) end end temp_kickboxVars['npc_max_health'] = temp_kickboxVars['npc_vital'] * 10 + temp_kickboxVars['npc_stren'] * 5 temp_kickboxVars['npc_health'] = temp_kickboxVars['npc_max_health'] temp_kickboxVars['npc_stam'] = (30 * (2 * temp_kickboxVars['npc_vital'] + temp_kickboxVars['npc_agil'] + temp_kickboxVars['npc_stren']) + 1000) / 13 end if $ARGS[0] = 'set_initiative': temp_kickboxVars['pcs_init'] = pcs_agil + pcs_react temp_kickboxVars['npc_init'] = temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react'] temp_kickboxVars['pcs_init_true'] = rand(temp_kickboxVars['pcs_init'] - temp_kickboxVars['pcs_init'] / 5, temp_kickboxVars['pcs_init'] + temp_kickboxVars['pcs_init'] / 5) temp_kickboxVars['npc_init_true'] = rand(temp_kickboxVars['npc_init'] - temp_kickboxVars['npc_init'] / 5, temp_kickboxVars['npc_init'] + temp_kickboxVars['npc_init'] / 5) if temp_kickboxVars['set_init'] = 0: temp_kickboxVars['set_init'] = 1 if temp_kickboxVars['pcs_init_true'] > temp_kickboxVars['npc_init_true'] and temp_kickboxVars['pcs_inittime'] < 3 or temp_kickboxVars['npc_inittime'] >= 3: temp_kickboxVars['active_init'] = 0 temp_kickboxVars['pcs_inittime'] += 1 temp_kickboxVars['npc_inittime'] = 0 'You take the initiative.' elseif temp_kickboxVars['pcs_init_true'] < temp_kickboxVars['npc_init_true'] and temp_kickboxVars['npc_inittime'] < 3 or temp_kickboxVars['pcs_inittime'] >= 3: temp_kickboxVars['active_init'] = 1 temp_kickboxVars['pcs_inittime'] = 0 temp_kickboxVars['npc_inittime'] += 1 '<<$boydesc>> took the initiative.' else if rand(0, 1) = 0: temp_kickboxVars['active_init'] = 0 temp_kickboxVars['pcs_inittime'] += 1 temp_kickboxVars['npc_inittime'] = 0 'You take the initiative.' else temp_kickboxVars['active_init'] = 1 temp_kickboxVars['pcs_inittime'] = 0 temp_kickboxVars['npc_inittime'] += 1 '<<$boydesc>> took the initiative.' end end end end if $ARGS[0] = 'attack': if $ARGS[1] = 'player': if $ARGS[2] = 'jab': temp_kickboxVars['damage'] = rand(pcs_stren / 12, pcs_stren / 8) temp_kickboxVars['hit_mod'] = (pcs_agil + pcs_react + pcs_jab) * 2 elseif $ARGS[2] = 'punch': temp_kickboxVars['damage'] = pcs_stren + rand(-pcs_stren / 5, pcs_stren / 5) temp_kickboxVars['hit_mod'] = (pcs_agil + pcs_react + pcs_punch) elseif $ARGS[2] = 'kick': temp_kickboxVars['damage'] = 3 * pcs_stren + rand(-3 * (pcs_stren / 5), 3 * (pcs_stren / 5)) temp_kickboxVars['hit_mod'] = (pcs_agil + pcs_react + pcs_kick) / 2 end temp_kickboxVars['hit_chance'] = temp_kickboxVars['hit_mod'] + rand(-temp_kickboxVars['hit_mod'] / 5, temp_kickboxVars['hit_mod'] / 5) if temp_kickboxVars['damage'] <= 0: temp_kickboxVars['damage'] = 1 temp_kickboxVars['base_def'] = temp_kickboxVars['npc_agil'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_def'] temp_kickboxVars['defence'] = temp_kickboxVars['base_def'] + rand(-temp_kickboxVars['base_def'] / 5, temp_kickboxVars['base_def'] / 5) if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence']: 'You''ve missed.' else if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence'] * 2: 'Contact' else 'HIT' temp_kickboxVars['damage'] += temp_kickboxVars['damage'] / 5 end temp_kickboxVars['npc_health'] -= temp_kickboxVars['damage'] temp_kickboxVars['pcs_points'] += 1 'You have dealt <> points of damage.' if temp_kickboxVars['damage'] >= temp_kickboxVars['npc_health'] / 5: temp_kickboxVars['pcs_points'] += 1 '<<$boydesc>> falls to the ground.' if temp_kickboxVars['npc_health'] < temp_kickboxVars['npc_max_health'] / 4: '<<$boydesc>> is knocked out. You''ve won!' temp_kickboxVars['KO'] = 1 end end end end if $ARGS[1] = 'enemy': if $ARGS[2] = 'jab': temp_kickboxVars['damage'] = rand(temp_kickboxVars['npc_stren'] / 12, temp_kickboxVars['npc_stren'] / 8) temp_kickboxVars['hit_mod'] = (temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_jab']) * 2 elseif $ARGS[2] = 'punch': temp_kickboxVars['damage'] = temp_kickboxVars['npc_stren'] + rand(-temp_kickboxVars['npc_stren'] / 5, temp_kickboxVars['npc_stren'] / 5) temp_kickboxVars['hit_mod'] = (temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_punch']) elseif $ARGS[2] = 'kick': temp_kickboxVars['damage'] = 3 * temp_kickboxVars['npc_stren'] + rand(-3 * (temp_kickboxVars['npc_stren'] / 5), 3 * (temp_kickboxVars['npc_stren'] / 5)) temp_kickboxVars['hit_mod'] = (temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_kick']) / 2 end temp_kickboxVars['hit_chance'] = temp_kickboxVars['hit_mod'] + rand(-temp_kickboxVars['hit_mod'] / 5, temp_kickboxVars['hit_mod'] / 5) if temp_kickboxVars['damage'] <= 0: temp_kickboxVars['damage'] = 1 temp_kickboxVars['base_def'] = pcs_agil + pcs_react + pcs_def temp_kickboxVars['defence'] = temp_kickboxVars['base_def'] + rand(-temp_kickboxVars['base_def'] / 5, temp_kickboxVars['base_def'] / 5) if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence']: 'Missed' else if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence'] * 2: 'You''ve gotten hit.' else 'You''ve gotten hit.' temp_kickboxVars['damage'] += temp_kickboxVars['damage'] / 5 end pcs_health -= temp_kickboxVars['damage'] temp_kickboxVars['npc_points'] += 1 'You have received <> points of damage.' if temp_kickboxVars['damage'] >= pcs_health / 5: temp_kickboxVars['npc_points'] += 1 'You have fallen to the ground.' if pcs_health < healthmax / 4: 'You are knocked out. You''ve lost!' temp_kickboxVars['KO'] = 1 end end end end end if $ARGS[0] = 'sash_advancement': if kickbox['sash'] = 0: if kickbox['advancement'] >= 5: kickbox['sash'] = 1 kickbox['advancement'] = 0 kickbox['money'] = 200 'Having covered red, yellow and orange in your basic training, you have now been awarded green sash(rank 4).' end elseif kickbox['sash'] = 1: if kickbox['advancement'] >= 10: kickbox['sash'] = 2 kickbox['advancement'] = 0 kickbox['money'] = 500 'You have been awarded purple sash(rank 5).' end elseif kickbox['sash'] = 2: if kickbox['advancement'] >= 15: kickbox['sash'] = 3 kickbox['advancement'] = 0 kickbox['money'] = 1500 'You have been awarded blue sash(rank 6).' end elseif kickbox['sash'] = 3: if kickbox['advancement'] >= 20: kickbox['sash'] = 4 kickbox['advancement'] = 0 kickbox['money'] = 3500 'You have been awarded brown sash(rank 7).' end elseif kickbox['sash'] = 4: if kickbox['advancement'] >= 25: kickbox['sash'] = 5 kickbox['advancement'] = 0 kickbox['money'] = 7500 'You have been awarded black sash, 1st dan.' end end end if $ARGS[0] = 'display_header': '= = = = = = = = = = = = = (ROUND <>) = = = = = = = = = = = = =' if temp_kickboxVars['time'] = 0: 'Start of the round' elseif temp_kickboxVars['time'] = 1: 'Time in round 0:30' elseif temp_kickboxVars['time'] = 2: 'Time in round 1:00' elseif temp_kickboxVars['time'] = 3: 'Time in round 1:30' elseif temp_kickboxVars['time'] = 4: 'Time in round 2:00' elseif temp_kickboxVars['time'] = 5: 'Time in round 2:30' else 'Time in round 3:00' end '<<$boydesc>> health <>, Stamina <>' 'Your health <>, stamina <>' '= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =' 'Your points: <> Opponent''s points: <>' '= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =' end if $ARGS[0] = 'display_header2': end --- kickboxing_funcs ---------------------------------