//HothEscape_b //Sets: // 1: Cannon fight troops // 2: state Base { Conditions { if Message "InitOnce_B" == 0 goto InitOnce if Message "InitOnce_B" == 1 goto Update } Actions { CnxController "from=door1_a" "to=door1_b" "off_flag=BLOCK" "obj=door_4" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door2_a" "to=door2_b" "off_flag=BLOCK" "obj=door_2" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" ;CnxController "from=door3_a" "to=door3_b" "off_flag=BLOCK" "obj=form_1_1" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door3_a" "to=door3_b" "on_flag=BLOCK" "obj=form_1_1" "checkvisible" "on_frames=1TOlastframe" "bothways" CnxController "from=door3_b" "to=door3_c" "off_flag=BLOCK" "obj=door_3" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door4_a" "to=door4_b" "off_flag=BLOCK" "obj=door_5" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" AddLocatorGroup "name=Fan" AddLocatorGroup "name=ZipR_Down" AddLocatorGroup "name=ZipL_Down" } } state InitOnce { Conditions { } Actions { SetMessage "name=CannonFightRound" "value=3" SetMessage "name=CannonFight" "value=0" SetMessage "name=L_CannonKilled" "value=0" SetMessage "name=R_CannonKilled" "value=0" SetMessage "name=InitOnce_B" "value=1" SetState "Update" } } state Update { Conditions { ;Dont set off the trooper cannons until they have been killed at least once if BuildItComplete "trooper_cannon1" == 0 and if Message "L_CannonKilled" == 0 goto L_Killed if BuildItComplete "trooper_cannon2" == 0 and if Message "R_CannonKilled" == 0 goto R_Killed ;If built the cannon and taken it over if Message "L_CannonKilled" == 1 and if BuildItComplete "trooper_cannon1" == 1 and if TakenOver "TrooperCannon_1" == 1 and if EitherPlayerInTriggerArea "C3PO_1" == 1 and if Message "CannonFightRound" > 0 and if Message "CannonFight" == 0 goto InitCannonFight if Message "R_CannonKilled" == 1 and if BuildItComplete "trooper_cannon2" == 1 and if TakenOver "TrooperCannon_2" == 1 and if EitherPlayerInTriggerArea "C3PO_1" == 1 and if Message "CannonFightRound" > 0 and if Message "CannonFight" == 0 goto InitCannonFight ;Or if at the door (once you have blown up the barrier...) if EitherPlayerInTriggerArea "C3P0_Door" == 1 and if ForceComplete "blowup_block_3" == 1 and if Message "CannonFightRound" > 0 and if Message "CannonFight" == 0 goto InitCannonFight if BuildItComplete "trooper_cannon1" == 1 and if BuildItComplete "trooper_cannon2" == 1 and if Message "CannonFight" > 0 and if NumInSetAlive "1" < 2 goto SpawnCannonFightC if BuildItComplete "trooper_cannon1" == 1 and if Message "CannonFight" > 0 and if NumInSetAlive "1" < 2 goto SpawnCannonFightL if BuildItComplete "trooper_cannon2" == 1 and if Message "CannonFight" > 0 and if NumInSetAlive "1" < 2 goto SpawnCannonFightR if Message "CannonFight" > 0 and if NumInSetAlive "1" < 2 goto SpawnCannonFightC } Actions { } } state L_Killed { Conditions { } Actions { SetMessage "name=L_CannonKilled" "value=1" SetState "Update" } } state R_Killed { Conditions { } Actions { SetMessage "name=R_CannonKilled" "value=1" SetState "Update" } } state InitCannonFight { Conditions { } Actions { SetMessage "name=CannonFight" "value=10" SetMessage "name=CannonFightRound" "decrement=1" Idle "5" SetState "Update" } } state SpawnCannonFightR { Conditions { } Actions { CreateCreatures "locator_group=ZipR_Down" "type=SnowTrooper" "script=SpawnAttack" "addtoset=1" "yoffset=2" "dont_set_on_surface" "zipdown" SetMessage "name=CannonFight" "decrement=1" SetState "Update" } } state SpawnCannonFightL { Conditions { } Actions { CreateCreatures "locator_group=ZipL_Down" "type=SnowTrooper" "script=SpawnAttack" "addtoset=1" "yoffset=2" "dont_set_on_surface" "zipdown" SetMessage "name=CannonFight" "decrement=1" SetState "Update" } } state SpawnCannonFightC { Conditions { if Random < 0.5 goto SpawnCannonFightR if AlwaysTrue == 1 goto SpawnCannonFightL } Actions { } }