From 22a7a1d3531b6d03621268166eb65f17d72f6f80 Mon Sep 17 00:00:00 2001 From: John Cote Date: Sun, 10 May 2015 20:54:19 -0400 Subject: [PATCH] Add ThrowBook Cog attack Assigned only to Big Wig. --- toontown/battle/MovieSuitAttacks.py | 45 +++++++++++++++++++++++++++- toontown/battle/SuitBattleGlobals.py | 35 +++++++++++++++------- 2 files changed, 69 insertions(+), 11 deletions(-) diff --git a/toontown/battle/MovieSuitAttacks.py b/toontown/battle/MovieSuitAttacks.py index 76b2e561..f90d55b8 100644 --- a/toontown/battle/MovieSuitAttacks.py +++ b/toontown/battle/MovieSuitAttacks.py @@ -244,7 +244,7 @@ def doSuitAttack(attack): elif name == TEE_OFF: suitTrack = doTeeOff(attack) elif name == THROW_BOOK: - suitTrack = doDefault(attack) + suitTrack = doThrowBook(attack) elif name == TREMOR: suitTrack = doTremor(attack) elif name == WATERCOOLER: @@ -3215,6 +3215,49 @@ def doEvictionNotice(attack): return Parallel(suitTrack, toonTrack, propTrack) +def doThrowBook(attack): + suit = attack['suit'] + battle = attack['battle'] + target = attack['target'] + toon = target['toon'] + dmg = target['hp'] + suitDelay = 2.0 + propDelay = 0.6 + throwDuration = 1.5 + paper = globalPropPool.getProp('lawbook') + suitTrack = getSuitTrack(attack) + posPoints = [Point3(0.00, -1.00, -1.85), VBase3(180.00, -45.00, -45.00)] + paperTrack = Sequence(getPropAppearTrack(paper, suit.getRightHand(), posPoints, propDelay, Point3(2.25, 2.25, 2.25), scaleUpTime=0.5)) + paperTrack.append(Wait(suitDelay)) + hitPoint = toon.getPos(battle) + hitPoint.setX(hitPoint.getX() + 1.2) + hitPoint.setY(hitPoint.getY() + 1.5) + if dmg > 0: + hitPoint.setZ(hitPoint.getZ() + 1.1) + movePoint = Point3(hitPoint.getX(), hitPoint.getY() - 1.8, hitPoint.getZ() + 0.2) + paperTrack.append(Func(battle.movie.needRestoreRenderProp, paper)) + paperTrack.append(Func(paper.wrtReparentTo, battle)) + paperTrack.append(getThrowTrack(paper, hitPoint, duration=throwDuration, parent=battle)) + paperTrack.append(Wait(0.6)) + paperTrack.append(LerpPosInterval(paper, 0.4, movePoint)) + spinTrack = Sequence(Wait(propDelay + suitDelay + 0.2), LerpHprInterval(paper, throwDuration, Point3(-360, 0, 0))) + sizeTrack = Sequence(Wait(propDelay + suitDelay + 0.2), LerpScaleInterval(paper, throwDuration, Point3(6, 6, 6)), Wait(0.95), LerpScaleInterval(paper, 0.4, MovieUtil.PNT3_NEARZERO)) + propTrack = Sequence(Parallel(paperTrack, spinTrack, sizeTrack), Func(MovieUtil.removeProp, paper), Func(battle.movie.clearRenderProp, paper)) + damageAnims = [] + damageAnims.append(['cringe', + 0.01, + 0.21, + 0.08]) + damageAnims.append(['slip-forward', + 0.01, + 0.6, + 0.85]) + damageAnims.extend(getSplicedLerpAnims('slip-forward', 0.31, 0.95, startTime=1.2)) + damageAnims.append(['slip-forward', 0.01, 1.51]) + toonTrack = getToonTrack(attack, damageDelay=4.35, splicedDamageAnims=damageAnims, dodgeDelay=2.4, dodgeAnimNames=['sidestep'], showDamageExtraTime=0.4, showMissedExtraTime=1.3) + return Parallel(suitTrack, toonTrack, propTrack) + + def doWithdrawal(attack): suit = attack['suit'] battle = attack['battle'] diff --git a/toontown/battle/SuitBattleGlobals.py b/toontown/battle/SuitBattleGlobals.py index 97afd841..b519fcc1 100644 --- a/toontown/battle/SuitBattleGlobals.py +++ b/toontown/battle/SuitBattleGlobals.py @@ -2863,11 +2863,26 @@ SuitAttributes = {'f': {'name': TTLocalizer.SuitFlunky, 85, 90, 95), - (50, - 50, - 50, - 50, - 50)), ('ThrowBook', + (33, + 33, + 33, + 33, + 33)), ('ThrowBook', + (14, + 16, + 18, + 20, + 22), + (70, + 75, + 85, + 90, + 95), + (33, + 33, + 33, + 33, + 33)), ('FingerWag', (13, 15, 17, @@ -2878,11 +2893,11 @@ SuitAttributes = {'f': {'name': TTLocalizer.SuitFlunky, 85, 85, 90), - (50, - 50, - 50, - 50, - 50)))}} + (33, + 33, + 33, + 33, + 33)))}} ATK_TGT_UNKNOWN = 1 ATK_TGT_SINGLE = 2 ATK_TGT_GROUP = 3