Beispiel #1
0
 private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
 {
     if (NetworkServer.active && damageReport.victimMaster && damageReport.victimMaster.GetKillerBodyIndex() != BodyIndex.None)
     {
         foreach (var teamMember in TeamComponent.GetTeamMembers(damageReport.victimTeamIndex))
         {
             if (teamMember.body && teamMember.body.inventory)
             {
                 int itemCount = teamMember.body.inventory.GetItemCount(itemDef);
                 if (itemCount > 0)
                 {
                     EntitySoundManager.EmitSoundServer(sfx.index, teamMember.body.gameObject);
                     teamMember.body.AddTimedBuff(MysticsItemsContent.Buffs.MysticsItems_AllyDeathRevenge, duration + durationPerStack * (itemCount - 1));
                 }
             }
         }
     }
 }
Beispiel #2
0
    void Awake()
    {
        Group = transform.parent.GetComponent<AIGroupController>();
        Aggro = GetComponentInChildren<AggroRadius>();
        MoveFSM = GetComponent<MovementFSM>();
        EntityObject = GetComponent<Entity>();
        _animationController = GetComponent<AnimationController>();

        SetupMachine(AIStates.idle);

        HashSet<Enum> idleTransitions = new HashSet<Enum>();
        idleTransitions.Add(AIStates.pursuit);
        idleTransitions.Add(AIStates.wander);

        HashSet<Enum> pursuitTransitions = new HashSet<Enum>();
        pursuitTransitions.Add(AIStates.dead);
        pursuitTransitions.Add(AIStates.reset);

        HashSet<Enum> resetTransitions = new HashSet<Enum>();
        resetTransitions.Add(AIStates.idle);

        HashSet<Enum> wanderTransitions = new HashSet<Enum>();
        wanderTransitions.Add(AIStates.idle);

        AddTransitionsFrom(AIStates.idle, idleTransitions);
        AddTransitionsFrom(AIStates.pursuit, pursuitTransitions);
        AddTransitionsFrom(AIStates.reset, resetTransitions);
        AddTransitionsFrom(AIStates.wander, wanderTransitions);

        StartMachine(AIStates.idle);
        _soundManager = GetComponent<EntitySoundManager>();
    }
Beispiel #3
0
    public void Awake()
    {
        inventory = new Inventory(); // LoadInventory();
        abilityManager = gameObject.GetComponent<AbilityManager>();
        equippedEquip = new Dictionary<equipSlots.slots, equipment>();
        _soundManager = GetComponent<EntitySoundManager>();

        equipAtt = new Attributes();
        buffAtt = new Attributes();
        baseAtt = new Attributes();

        baseAtt.Health = currentHP = 100;
        baseAtt.Resource = currentResource = 100;

        baseAtt.Power = 10;
        baseAtt.Defense = 10;

        baseAtt.AttackSpeed = 0;
        baseAtt.MovementSpeed = 1.0f;

        level = 1;
        experience = 0;
    }
Beispiel #4
0
    void Awake()
    {
        SetupMachine(PursuitStates.inactive);

        HashSet<Enum> inactiveTransitions = new HashSet<Enum>();
        inactiveTransitions.Add(PursuitStates.approach);
        AddTransitionsFrom(PursuitStates.inactive, inactiveTransitions);
        AddAllTransitionsTo(PursuitStates.inactive);

        HashSet<Enum> approachTransitions = new HashSet<Enum>();
        approachTransitions.Add(PursuitStates.seek);
        approachTransitions.Add(PursuitStates.flee);
        AddTransitionsFrom(PursuitStates.approach, approachTransitions);

        AddAllTransitionsFrom(PursuitStates.seek);

        HashSet<Enum> attackTransitions = new HashSet<Enum>();
        attackTransitions.Add(PursuitStates.seek);
        attackTransitions.Add(PursuitStates.flee);
        AddTransitionsFrom(PursuitStates.attack, attackTransitions);

        HashSet<Enum> fleeTransitions = new HashSet<Enum>();
        fleeTransitions.Add(PursuitStates.approach);
        fleeTransitions.Add(PursuitStates.inactive);
        fleeTransitions.Add(PursuitStates.flee);
        AddTransitionsFrom(PursuitStates.flee, fleeTransitions);

        StartMachine(PursuitStates.inactive);

        hasFled = false;
        doesFlee = true;
        _swinging = false;

        entity = GetComponent<Entity>();
        MoveFSM = GetComponent<MovementFSM>();
        combatFSM = GetComponent<CombatFSM>();
        _abilityManager = GetComponent<AbilityManager>();
        _animationController = GetComponent<AnimationController>();
        _soundManager = GetComponent<EntitySoundManager>();
        _collider = GetComponent<CapsuleCollider>();
    }