Ejemplo n.º 1
0
    public override void OnInitialize()
    {
        animator = actor.GetComponent <Animator>();

        combatController = actionPack.actionController as CombatController;

        combatProfile = (actor.profile as CombatantProfile).combatProfile;

        inventory = (actor.profile as CombatantProfile).inventory as PlayerInventory;

        inventory.OnQuickSlotEquipped += (entry =>
        {
            if (entry.Value.Item is RangedWeapon)
            {
                actor.OnAnimatorIk += Look;
            }
        });

        inventory.OnQuickSlotUnEquipped += (entry =>
        {
            if (entry.Value.Item is RangedWeapon)
            {
                actor.OnAnimatorIk -= Look;
            }
        });
    }
Ejemplo n.º 2
0
    public override void OnInitialize()
    {
        combatProfile = (actor.profile as CombatantProfile).combatProfile;

        inventory = (actor.profile as CombatantProfile).inventory as PlayerInventory;

        inventory.OnQuickSlotEquipped += (entry =>
        {
            if (entry.Value.Item is RangedWeapon)
            {
                CameraManager.Instance.CrossHair.enabled = true;

                RangedWeaponFlavor flavor = entry.Value.Item.flavor as RangedWeaponFlavor;

                crossHair = flavor.TargetSprite;

                crossHairSize = flavor.TargetSize;
            }
        });

        inventory.OnQuickSlotUnEquipped += (entry =>
        {
            if (entry.Value.Item is RangedWeapon)
            {
                CameraManager.Instance.CrossHair.enabled = false;
            }
        });
    }
Ejemplo n.º 3
0
    public override void OnInitialize()
    {
        combatProfile = (actor.profile as CombatantProfile).combatProfile;

        combatController = actionPack.actionController as CombatController;

        animator = actor.GetComponent <Animator>();
    }
Ejemplo n.º 4
0
        public static AttackResult ResolveAttack(CombatProfile attacker, CombatProfile defender)
        {
            var attackRoll = DiceHelper.RollD6() + DiceHelper.RollD6() + attacker.Attack;

            if (attackRoll < defender.Defense)
                return new AttackResult { Result = AttackResultCode.Missed, DamageDone = 0 };

            var attackDamage = DiceHelper.RollD6() + DiceHelper.RollD6() + attacker.Strength;
            var damageDone = attackDamage - defender.Armor;

            if (damageDone <= 0)
                return new AttackResult { Result = AttackResultCode.ArmorBlocked, DamageDone = 0 };
            else
                return new AttackResult { Result = AttackResultCode.DidDamage, DamageDone = damageDone };

        }
Ejemplo n.º 5
0
    public override void OnInitialize()
    {
        combatController = actionPack.actionController as CombatController;

        combatProfile = (actor.profile as CombatantProfile).combatProfile;
    }
Ejemplo n.º 6
0
 //todo
 public Enemy(CombatProfile cp, CombatStatus cs, EquipConfig eq) : base(cp, cs, eq)
 {
 }
Ejemplo n.º 7
0
 public Combatant(CombatProfile cp, CombatStatus cs, EquipConfig eq)
 {
     this.Profile = cp;
     this.Status  = cs;
     this.Equip   = eq;
 }