# fight !! Variables to be set before fight - in brackets so you can copy/paste !!{ $opp_name[0] = <> $opp_image[0] = opponent image ie. '> src="images/characters/city/tobi/tobi.jpg">' opp_def[0] = opponent defence opp_run[0] = Opponent running skill used for player escape opp_wrstlng[0] = Wrestling skill opp_kick[0] = Kicking opp_punch[0] = Power punch opp_jab[0] = Ligth punch opp_stren[0] = Strengh opp_agil[0] = Agility opp_vital[0] = vitality opp_react[0] = Reactions opp_health[0] = Health opp_willpwr[0] = willpower opp_shoot[0] = opponent marksmanship (only required if they are armed) opp_magik[0] = only if they have magic opp_mana[0] = only if they have magic opp_fog[0] = (tuman): Obscures vision, makes hitting harder. opp_clone[0] = (klon): Copies of the char that absorb 1 hit and disappear. A char may have some number of them. opp_shield[0] = (defence): Shielding that absorbs damage before hitpoints. opp_dambonus[0] = (magweapbonus): damage added to melee attacks opp_init[0] = (initBonus): attack faster/first opp_stun[0] = (stunner): make target unable to act for some amount of time } !! Use the above with [1] and [2] for extra opponents !! Use pcs_ prefix for Sveta and add [1] and [2] for allies. ie. $pcs_name[1] = 'Reinhold' if $ARGS[0] = 'initFight': !! Clear Opponents from previous battle killvar '$opp_name' killvar '$opp_image' killvar 'opp_def' killvar 'opp_run' killvar 'opp_wrstlng' killvar 'opp_kick' killvar 'opp_punch' killvar 'opp_jab' killvar 'opp_stren' killvar 'opp_agil' killvar 'opp_vital' killvar 'opp_react' killvar 'opp_health' killvar 'opp_willpwr' killvar 'opp_shoot' killvar 'opp_magik' killvar 'opp_mana' killvar 'opp_fog' killvar 'opp_clone' killvar 'opp_shield' killvar 'opp_dambonus' killvar 'opp_init' killvar 'opp_stun' killvar 'opp_timer' !! Clear any allies from previous battle i = arrsize('pcs_health') :ClearAllyLoop if i > 1: gs 'fight', 'clearPCSArray', i-1 i -= 1 jump 'ClearAllyLoop' end killvar 'i' !! Initialize $pcs_name for Sveta $pcs_name[0] = 'You' $pcs_image[0] = FUNC('$face_image') end if $ARGS[0] = 'clearPCSArray': !{ Delete an Ally from the pcs data arrays ARGS[1] = Which ally slot tot delete } i = ARGS[1] killvar '$pcs_name', i killvar '$pcs_image', i killvar 'pcs_def', i killvar 'pcs_run', i killvar 'pcs_wrstlng', i killvar 'pcs_kick', i killvar 'pcs_punch', i killvar 'pcs_jab', i killvar 'pcs_stren', i killvar 'pcs_agil', i killvar 'pcs_vital', i killvar 'pcs_react', i killvar 'pcs_health', i killvar 'pcs_willpwr', i killvar 'pcs_shoot', i killvar 'pcs_magik', i killvar 'pcs_mana', i killvar 'pcs_fog', i killvar 'pcs_clone', i killvar 'pcs_shield', i killvar 'pcs_dambonus', i killvar 'pcs_init', i killvar 'pcs_stun', i killvar 'pcs_timer', i killvar 'i' end if $ARGS[0] = 'randomOpp': !{ Generate a random Opponent ARGS[1] = Optional, raise difficulty of the attacker, 0 - 50 } OppDiffBonus = ARGS[1] i = arrsize('opp_health') $opp_name[i] = 'Opponent 1' $opp_image[i] = 'images/locations/shared/street/mugger.jpg' opp_def[i] = rand(1,50) + OppDiffBonus opp_run[i] = rand(1,50) + OppDiffBonus opp_wrstlng[i] = rand(1,50) + OppDiffBonus opp_kick[i] = rand(1,50) + OppDiffBonus opp_punch[i] = rand(1,50) + OppDiffBonus opp_jab[i] = rand(1,50) + OppDiffBonus opp_stren[i] = rand(1,50) + OppDiffBonus opp_agil[i] = rand(1,50) + OppDiffBonus opp_vital[i] = rand(1,50) + OppDiffBonus opp_health[i] = (opp_vital * 10 + opp_stren * 5) opp_react[i] = rand(1,50) + OppDiffBonus opp_willpwr[i] = rand(1,50) + OppDiffBonus opp_shoot[i] = rand(1,50) + OppDiffBonus killvar 'OppDiffBonus' killvar 'i' end if $ARGS[0] = 'applyDamage': !{ Apply Damage to a participant taking into account clones and shields $ARGS[1] = Target Type ('opp','pcs') ARGS[2] = Target number ARGS[3] = damage to be applied } $fightAppDam['TargetType'] = $ARGS[1] fightAppDam['TargetNumber'] = ARGS[2] fightAppDam['Damage'] = ARGS[3] dynamic " !!If the target has clones, destroy one if <<$fightAppDam['TargetType']>>_clone[<>] > 0: <<$fightAppDam['TargetType']>>_clone[<>] -= 1 'Clone Destroyed!' !!if the target has enough shields to mitigate, remove some shields elseif <<$fightAppDam['TargetType']>>_shield[<>] >= fightAppDam['Damage']: <<$fightAppDam['TargetType']>>_shield[<>] -= fightAppDam['Damage'] !!otherwise remove shields to 0 and the remainder comes from health else <<$fightAppDam['TargetType']>>_health -= (fightAppDam['Damage'] - <<$fightAppDam['TargetType']>>_shield[<>]) <<$fightAppDam['TargetType']>>_shield[<>] = 0 end" killvar '$fightAppDam' killvar 'fightAppDam' end if $ARGS[0] = 'start': menu_off = 1 inFight = 1 gs 'themes', 'indoors' cla if arrsize('pcs_health') > arrsize('opp_health'): tableSize = arrsize('pcs_health') else tableSize = arrsize('opp_health') end $HTMLText = '' i = 0 :FightPoster if i < tableSize: $HTMLText += ' ' i += 1 jump 'FightPoster' end $HTMLText += '
Allies > >vs. Opponents
<<$pcs_name[i]>> <<$opp_name[i]>>
' *pl func('cleanHTML',$HTMLText) i=0 :PCSTimerInit if i < arrsize('pcs_health'): pcs_timer[i] = 100 - pcs_react[i] i +=1 jump 'PCSTimerInit' end i=0 :OppTimerInit if i < arrsize('opp_health'): opp_timer[i] = 100 - opp_react[i] i +=1 jump 'OppTimerInit' end act 'Engage': gt 'fight', 'main' killvar '$HTMLText' killvar 'tableSize' killvar 'i' end if $ARGS[0] = 'findActiveTimer': !! Find the participant with the lowest Timer ! These values are passed back via two global variables. ! ! $fightTimType = 'player' or 'opponent' depending on which group has the lowest member ! fightTimNum = the array number of the lowest participant $fightTimType = 'player' fightTimNum = 0 !! set this to high so that everyone will be lower. fightTimLow = 99999 !! Find lowest of pcs participants i = 0 :LowTimerLoop1 if i < arrsize('pcs_timer'): if pcs_timer[i] < fightTimLow: fightTimLow = pcs_timer[i] fightTimNum = i end i += 1 jump 'LowTimerLoop1' end !!Find if any Opponents have lower than best PCS i = 0 :LowTimerLoop2 if i < arrsize('opp_timer'): if opp_timer[i] < fightTimLow: fightTimLow = opp_timer[i] fightTimNum = i $fightTimType = 'opponent' end i += 1 jump 'LowTimerLoop2' end killvar 'i' end if $ARGS[0] = 'main': gs 'fight', 'result_check' gs 'fight', 'findActiveTimer' gt 'fight', $fightTimType, fightTimNum end if $ARGS[0] = 'printStats': !{ Print the stats for a character $ARGS[1] = The Type of char ('opp','pcs') ARGS[2] = The member of the party } $fightPStats['CharType'] = $ARGS[1] i = ARGS[2] if $fightPStats['CharType'] = 'opp': $fightPStats['Name'] = $opp_name[i] fightPStats['Health'] = opp_health[i] fightPStats['Mana'] = opp_mana[i] fightPStats['Willpower'] = opp_willpwr[i] fightPStats['Shield'] = opp_shield[i] fightPStats['Fog'] = opp_fog[i] fightPStats['Clone'] = opp_clone[i] else $fightPStats['Name'] = $pcs_name[i] fightPStats['Health'] = pcs_health[i] fightPStats['Mana'] = pcs_mana[i] fightPStats['Willpower'] = pcs_willpwr[i] fightPStats['Shield'] = pcs_shield[i] fightPStats['Fog'] = pcs_fog[i] fightPStats['Clone'] = pcs_clone[i] end '<<$fightPStats["Name"]>> life <>, mana <>, willpower <>' if fightPStats['Shield'] > 0:'Protection <> units' if fightPStats['Clone'] > 0:'Clones active <> ' if fightPStats['Fog'] > 0:'Obscuring Fog <> units' '= = = = = = = = = = = = = = = = = = = = = = = = = = = = =' killvar 'i' killvar 'fightPStats' killvar '$fightPStats' end if $ARGS[0] = 'statDisplay': '= = = = = = = = = = = O p p o n e n t s = = = = = = = = = = =' i = 0 :OppLoopRC1 if i < arrsize('opp_health'): gs 'fight', 'printStats', 'opp', i i += 1 jump 'OppLoopRC1' end *nl '= = = = = = = = = = = = A l l i e s = = = = = = = = = = = = =' i = 0 :PCSLoopRC1 if i < arrsize('pcs_health'): gs 'fight', 'printStats', 'pcs', i i += 1 jump 'PCSLoopRC1' end end if $ARGS[0] = 'result_check': !!cheat to auto-win fights check if fight_cheat = 1: xgt 'ender', 'win' gt $loc, $metka exit end !!win/lose conditions if pcs_health <= 0: ' You lost!' xgt'ender','loss' gt $loc, $metka exit elseif opp_health[0] <= 0: '<<$boydesc>> You won!' xgt'ender','win' gt $loc, $metka exit elseif pcs_willpwr <= 0: ' You cannot summon the will to fight!' xgt'ender','loss' gt $loc, $metka exit end !gt 'fight', 'main' killvar 'i' end !! Kick $AttackType[0] = 'Kick' $AttackSkill[0] = 'kick' AttackMin[0] = 5 AttackMax[0] = 8 AttackTime[0] = 40 !! Hard Punch $AttackType[1] = 'Hard Punch' $AttackSkill[1] = 'punch' AttackMin[1] = 4 AttackMax[1] = 6 AttackTime[1] = 30 !! Jab $AttackType[2] = 'Jab' $AttackSkill[2] = 'jab' AttackMin[2] = 2 AttackMax[2] = 3 AttackTime[2] = 15 !!{Attack a target $ARGS[0] = Attack Type $ARGS[1] = Target Type ARGS[2] = Which target ARGS[3] = Which Attacker } if $ARGS[0] = 'Attack': $fightAtk_Type = $ARGS[1] $fightAtk_TargetType = $ARGS[2] fightAtk_TargetNumber = ARGS[3] fightAtk_AttackerNumber = ARGS[4] if $fightAtk_TargetType = 'opp' and fightAtk_AttackerNumber = 0: $fightAtk_AttackerType = 'pcs' $fightAtk['DefenderName'] = $opp_name[fightAtk_TargetNumber] $fightAtk['AttackerName'] = 'You' elseif $fightAtk_TargetType = 'opp': $fightAtk['AttackerName'] = $pcs_name[fightAtk_AttackerNumber] $fightAtk['DefenderName'] = $opp_name[fightAtk_TargetNumber] $fightAtk_AttackerType = 'pcs' else $fightAtk_AttackerType = 'opp' $fightAtk['AttackerName'] = $opp_name[fightAtk_AttackerNumber] $fightAtk['DefenderName'] = $pcs_name[fightAtk_TargetNumber] end fightAtk_Type = arrpos('$AttackType',$fightAtk_Type) fightAtk['AttackerSkillValue'] = dyneval('result = <<$fightAtk_AttackerType>>_<<$AttackSkill[fightAtk_Type]>>[<>]') fightAtk['TargetReactValue'] = dyneval('result = <<$fightAtk_TargetType>>_react[<>]') fightAtk['TargetAgilValue'] = dyneval('result = <<$fightAtk_TargetType>>_agil[<>]') fightAtk['MinDamage'] = AttackMin[fightAtk_Type] fightAtk['MaxDamage'] = AttackMax[fightAtk_Type] if $fightAtk_TargetType = 'opp' and fightAtk_AttackerNumber = 0: 'You attempt to <<$fightAtk_Type>> <<$fightAtk["DefenderName"]>>!' else '<<$fightAtk["AttackerName"]>> attempts to <<$fightAtk_Type>> <<$fightAtk["DefenderName"]>>!' end *nl if fightAtk['AttackerSkillValue'] + rand(0,30) > fightAtk['TargetReactValue'] / 4 + 3 * fightAtk['TargetAgilValue'] / 4: !!Calculate Damage dynamic "fightAtk['Damage'] = <<$fightAtk_AttackerType>>_stren[<>] * rand(<>,<>) / 15" !!Apply Damage gs 'fight', 'applyDamage', $fightAtk_TargetType, fightAtk_TargetNumber, fightAtk['Damage'] if fightAtk['Damage'] > 10: if $fightAtk_TargetType = 'opp' and fightAtk_AttackerNumber = 0: 'The hit is hard and <<$fightAtk["DefenderName"]>> reels in pain.' else 'The hit is hard and you reel in pain.' end else 'Its a glancing blow, but still hurts.' end else if $fightAtk_TargetType = 'pcs' and fightAtk_AttackerNumber = 0: 'You avoid the blow.' else '<<$fightAtk["DefenderName"]>> avoids the blow.' end end dynamic "<<$fightAtk_AttackerType>>_timer += AttackTime[fightAtk_Type]" cla act 'Next': gt 'fight', 'main' end if $ARGS[0] = 'opponent': gs 'fight', 'statDisplay' if pcs_health[0] > 0 and pcs_health[1] > 0 and pcs_health[2] > 0: TargetNumber = rand(0,2) elseif pcs_health[0] > 0 and pcs_health[1] > 0: TargetNumber = rand(0,1) elseif pcs_health[0] > 0 and pcs_health[2] > 0: if rand(0,1) = 0: TargetNumber = 0 else TargetNumber = 2 end elseif pcs_health[1] > 0 and pcs_health[2] > 0: TargetNumber = rand(1,2) elseif pcs_health[0] > 0: TargetNumber = 0 elseif pcs_health[1] > 0: TargetNumber = 1 else TargetNumber = 2 end !! if opp_magik[0] > 0: gs 'fight', 'opp_spellcast' if rand(0,opp_kick[0]) > 40: gs 'fight', 'Attack', 'Kick', 'pcs', ARGS[2], TargetNumber elseif rand(0,opp_punch[0]) > 40: gs 'fight', 'Attack', 'Hard Punch', 'pcs', ARGS[2], TargetNumber else gs 'fight', 'Attack', 'Jab', 'pcs', ARGS[2], TargetNumber end end if $ARGS[0] = 'player': gs 'fight', 'statDisplay' if opp_health[0] > 0 and opp_health[1] > 0 and opp_health[2] > 0: TargetNumber = rand(0,2) elseif opp_health[0] > 0 and opp_health[1] > 0: TargetNumber = rand(0,1) elseif opp_health[0] > 0 and opp_health[2] > 0: if rand(0,1) = 0: TargetNumber = 0 else TargetNumber = 2 end elseif opp_health[1] > 0 and opp_health[2] > 0: TargetNumber = rand(1,2) elseif opp_health[0] > 0: TargetNumber = 0 elseif opp_health[1] > 0: TargetNumber = 1 else TargetNumber = 2 end if pcs_magik > 0: act 'Cast a Spell': gs 'fight', 'spellcast' end if opp_health[0] > 0: act 'Kick <<$opp_name[0]>>': gs 'fight', 'Attack', 'Kick', 'opp', 0, 0 end act 'Punch <<$opp_name[0]>> hard': gs 'fight', 'Attack', 'Hard Punch', 'opp', 0, 0 end act 'Jab <<$opp_name[0]>>': gs 'fight', 'Attack', 'Jab', 'opp', 0, 0 end end if opp_health[1] > 0: act 'Kick <<$opp_name[1]>>': gs 'fight', 'Attack', 'Kick', 'opp', 0, 1 end act 'Punch <<$opp_name[1]>> hard': gs 'fight', 'Attack', 'Hard Punch', 'opp', 0, 1 end act 'Jab <<$opp_name[1]>>': gs 'fight', 'Attack', 'Jab', 'opp', 0, 1 end end if opp_health[2] > 0: act 'Kick <<$opp_name[2]>>': gs 'fight', 'Attack', 'Kick', 'opp', 0, 2 end act 'Punch <<$opp_name[2]>> hard': gs 'fight', 'Attack', 'Hard Punch', 'opp', 0, 2 end act 'Jab <<$opp_name[2]>>': gs 'fight', 'Attack', 'Jab', 'opp', 0, 2 end end end if $ARGS[0] = 'opp_spellcast': end if $ARGS[0] = 'pcs_spellcast': end !!--------------------------------------------------old shit-------------------------------------------------- if $ARGS[0] = 'sta': menu_off = 1 cla damTip = 0 damTipM = 0 damTipV = 0 damTipMV = 0 magweapbonus = 0 magweapbonusV = 0 bonusSh = 0 bonusShV = 0 eleSh = 0 eleShV = 0 poisonAV = 0 hidanAtk = 0 '= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =' '<<$boydesc>> life <>, mana <>, willpower <>' if defenceV > 0:'Protection <> units' if defenceMV > 0:'Mana protection <> units' if defenceWV > 0:'Will protection <> units' 'Your life <>, mana <>, willpower <>' if defence > 0:'Protection <> units' if defenceM > 0:'Mana impact protection <> units' if defenceW > 0:'Will impact protection <> units' if defenceAct > 0:'<> Regeneration' if defenceActM > 0:'<> Mana recovery protection' '= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =' if autocombat_cheat = 0: act 'Continue':gt'fight','start' if autocombat_cheat = 1: gt'fight','start' end if $ARGS[0] = 'Wrestlergen': if nopornowrestling = 0: nopornowrestling = 1 NPCnum = 30 NPCnow = 1 !!shag = 1 gs 'npc' NoView = 1 NPCrost = 30 gs 'generation' NoView = 1 NPCrost = 30 gs 'generation' NoView = 1 NPCrost = 30 gs 'generation' NoView = 1 NPCrost = 30 gs 'generation' NoView = 1 NPCrost = 30 gs 'generation' $nikname[1] = 'schoolgirl' !!musle[0] = 100 !!flex[0] = pcs_agil !!stamina[0] = pcs_vital * 3 !!wipo[0] = pcs_sprt !!pcs_intel[0] = 10 !!krasota[0] = pcs_apprnc !!pcs_hgt[0] = 165 !!salo[0] = 100 !!fat[0] = 100 !!$nikname[1] = 'steel Virgo' !!musle[1] = 100 !!flex[1] = 100 !!stamina[1] = 300 !!wipo[1] = 50 !!pcs_intel[1] = 10 !!krasota[1] = 10 !!pcs_hgt[1] = 165 !!salo[1] = 100 !!fat[1] = 100 end end --- fight ---------------------------------