def __init__(self, air):
     try:
         self.DistributedPlayerToonAI_initialized
         return
     except:
         self.DistributedPlayerToonAI_initialized = 1
     DistributedToonAI.__init__(self, air)
     DistributedPlayerToonShared.__init__(self)
     self.money = 0
     self.portal = None
     self.book = None
     self.role = None
     self.ghost = 0
     self.attackers = []
     self.puInventory = []
     self.equippedPU = -1
     self.backpack = BackpackAI(self)
     self.backpackNetString = ""
     self.quests = ""
     self.questHistory = []
     self.tier = -1
     self.friends = []
     self.tutDone = 0
     self.hoodsDiscovered = []
     self.teleportAccess = []
     self.lastHood = 0
     self.defaultShard = 0
     self.currentGag = -1
     self.trackExperience = dict(GagGlobals.DefaultTrackExperiences)
     return
Esempio n. 2
0
 def __init__(self, air):
     DistributedToonAI.__init__(self, air)
     self.money = 0
     self.viewOrigin = Vec3()
     self.viewAngles = Vec3()
     self.viewAngleVectors = []
     self.numbers = []
Esempio n. 3
0
    def __init__(self, air, dispatch):
        DistributedEntityAI.__init__(self, air, dispatch)
        DistributedToonAI.__init__(self, air)
        BaseNPCAI.__init__(self, dispatch)
        self.setBattleZone(dispatch)

        from src.coginvasion.attack.Attacks import ATTACK_GAG_WHOLECREAMPIE
        self.attackIds = [ATTACK_GAG_WHOLECREAMPIE]

        self.died = False

        self.hpBarrel = None

        self.schedules.update({
            "GET_HP_FROM_BARREL":
            Schedule(
                [
                    Task_StopMoving(self),
                    Task_StopAttack(self),
                    Task_RememberPosition(
                        self
                    ),  # remember where we were, we will return there after grabbing some HP
                    Task_FindBestHPBarrel(self),
                    Task_GetPathToHPBarrel(self),
                    Task_Speak(self, 0.5, [
                        "I need more Laff points.",
                        "I'm grabbing a Laff barrel!",
                        "Hang on, I need this Laff barrel.", "I need Laff!"
                    ]),
                    Task_RunPath(self),
                    Task_AwaitMovement(self),
                    Task_GrabHPBarrel(self),
                    Task_ClearHPBarrel(self),
                    Task_SetSchedule(self, "RETURN_TO_MEMORY_POSITION")
                ],
                interruptMask=COND_HEAVY_DAMAGE)
        })
Esempio n. 4
0
    def __init__(self, air, dispatch):
        DistributedToonAI.__init__(self, air)
        BaseNPCAI.__init__(self, dispatch)
        self.setDispatch(dispatch)
        self.setBattleZone(dispatch)

        from src.coginvasion.attack.Attacks import ATTACK_GAG_WHOLECREAMPIE
        self.attackIds = [ATTACK_GAG_WHOLECREAMPIE]

        self.died = False

        self.hpBarrel = None

        self.followTarget = None

        self.schedules.update({
            "HEAL_FOLLOW_TARGET":
            Schedule([
                Task_StopMoving(self),
                Task_FaceFollowTarget(self),
                Task_Speak(self, 0.75, [
                    "Patch yourself up!", "Here, this'll help!",
                    "Let me help you out!", "Heads up!"
                ]),
                Task_EquipAttack(self, ATTACK_GAG_WHOLECREAMPIE),
                Task_FireHealAttack(self),
                Task_AwaitAttack(self)
            ],
                     interruptMask=COND_SCHEDULE_DONE | COND_TASK_FAILED
                     | COND_LIGHT_DAMAGE | COND_HEAVY_DAMAGE | COND_NEW_TARGET
                     | COND_VP_JUMPING),
            "GET_HP_FROM_BARREL":
            Schedule(
                [
                    Task_StopMoving(self),
                    Task_StopAttack(self),
                    Task_RememberPosition(
                        self
                    ),  # remember where we were, we will return there after grabbing some HP
                    Task_FindBestHPBarrel(self),
                    Task_GetPathToHPBarrel(self),
                    Task_Speak(self, 0.5, [
                        "I need more Laff points.",
                        "I'm grabbing a Laff barrel!",
                        "Hang on, I need this Laff barrel.", "I need Laff!"
                    ]),
                    Task_MoveShoot(self),
                    Task_GrabHPBarrel(self),
                    Task_ClearHPBarrel(self),
                    Task_SetSchedule(self, "RETURN_TO_MEMORY_POSITION")
                ],
                interruptMask=COND_VP_JUMPING | COND_HEAVY_DAMAGE
                | COND_IN_WALL),
            "RUN_TO_FOLLOW_TARGET":
            Schedule([
                Task_StopAttack(self),
                Task_StopMoving(self),
                Task_GetPathToFollowTarget(self),
                Task_RunPath(self),
                Task_RunToFollowTarget(self),
                Task_FaceFollowTarget(self)
            ],
                     interruptMask=COND_NEW_TARGET | COND_SCHEDULE_DONE
                     | COND_TASK_FAILED | COND_IN_WALL),
            "FOLLOW_TARGET_FACE":
            Schedule([
                Task_StopAttack(self),
                Task_StopMoving(self),
                Task_FaceFollowTarget(self)
            ],
                     interruptMask=COND_NEW_TARGET | COND_SCHEDULE_DONE
                     | COND_TASK_FAILED),
            "MAINTAIN_FOLLOW_TARGET":
            Schedule([
                Task_StopAttack(self),
                Task_StopMoving(self),
                Task_MaintainFollowTarget(self)
            ],
                     interruptMask=COND_VP_JUMPING | COND_SEE_FEAR
                     | COND_NEW_TARGET | COND_LIGHT_DAMAGE | COND_HEAVY_DAMAGE
                     | COND_HEAR_DANGER | COND_HEAR_HATE | COND_FRIEND_IN_WAY
                     | COND_HEAR_SOMETHING | COND_IN_WALL),
            "VP_JUMP_DODGE":
            Schedule([
                Task_StopAttack(self),
                Task_StopMoving(self),
                Task_Wait(0.5),
                Task_SetActivity(self, ACT_JUMP),
                Task_AwaitActivity(self)
            ],
                     interruptMask=COND_SCHEDULE_DONE | COND_TASK_FAILED),
            "VP_JUMP_REACT":
            Schedule([
                Task_StopAttack(self),
                Task_StopMoving(self),
                Task_SetActivity(self, ACT_TOON_FALL),
                Task_AwaitActivity(self)
            ],
                     interruptMask=COND_SCHEDULE_DONE | COND_TASK_FAILED),
        })

        self.schedules["YIELD_TO_FRIEND"].prependTask(
            Task_Speak(
                self, 0.4,
                ["Sorry.", "Let me get out of your way.", "Excuse me."]))

        self.schedules["IDLE_STAND"].interruptMask |= COND_VP_JUMPING
        self.schedules["COMBAT_FACE"].interruptMask |= COND_VP_JUMPING
        self.schedules[
            "TAKE_COVER_FROM_ORIGIN"].interruptMask |= COND_VP_JUMPING
        self.schedules[
            "TAKE_COVER_FROM_TARGET"].interruptMask |= COND_VP_JUMPING
        self.schedules["CHASE_TARGET"].interruptMask |= COND_VP_JUMPING
        self.schedules["ATTACK"].interruptMask |= COND_VP_JUMPING
        self.schedules["MAKE_ATTACK_LOS"].interruptMask |= COND_VP_JUMPING
        self.schedules["ALERT_FACE"].interruptMask |= COND_VP_JUMPING
        self.schedules[
            "RETURN_TO_MEMORY_POSITION"].interruptMask |= COND_VP_JUMPING