Exemplo n.º 1
0
 public static void StealMessage(BadGuy badGuy, GoodGuy goodGuy, double amount)  // parameters came from BadGuy class steal method
 {
     Show.Formatted(badGuy.Name + " stole " + amount + " from " + goodGuy.Name); // formatted writeLine
     Show.Money(badGuy);                                                         // uses the submethod to automatically grab badGuy.name and badGuy.money
     // to pass them as the string and double parameters in the main Money method.
     Show.Money(goodGuy);
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Show.HorizontalDivider();

            GoodGuy harry = new GoodGuy("Harry Potter", 999);
            GoodGuy hermione = new GoodGuy("Hermione Granger", 200);
            GoodGuy ron = new GoodGuy("Ron Weasley", 100);

            BadGuy voldemort = new BadGuy("Tom Riddle", 800);
            BadGuy bellatrix = new BadGuy("Bellatrix Lestrange", 600);
            BadGuy draco = new BadGuy("Draco Malfoy", 400);

            Show.HorizontalDivider();

            voldemort.Steal(harry, 200);
            voldemort.Steal(draco, 200);
            bellatrix.Steal(draco, 200);

            harry.Capture(bellatrix);
            harry.Give(hermione, 400);
            harry.Give(ron, 400);

            Show.HorizontalDivider();
            System.Console.ReadKey();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Show.HorizontalDivider();

            GoodGuy harry    = new GoodGuy("Harry Potter", 999);
            GoodGuy hermione = new GoodGuy("Hermione Granger", 200);
            GoodGuy ron      = new GoodGuy("Ron Weasley", 100);

            BadGuy voldemort = new BadGuy("Tom Riddle", 800);
            BadGuy bellatrix = new BadGuy("Bellatrix Lestrange", 600);
            BadGuy draco     = new BadGuy("Draco Malfoy", 400);

            Show.HorizontalDivider();

            voldemort.Steal(harry, 200);
            voldemort.Steal(draco, 200);
            bellatrix.Steal(draco, 200);

            harry.Capture(bellatrix);
            harry.Give(hermione, 400);
            harry.Give(ron, 400);

            Show.HorizontalDivider();
            System.Console.ReadKey();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Show.HorizontalDivider();

            GoodGuy Harry    = new GoodGuy("Harry Potter", 999);
            GoodGuy Hermione = new GoodGuy("Hermione Granger", 200);
            GoodGuy Ron      = new GoodGuy("Ron Weasley", 100);

            BadGuy Voldemort = new BadGuy("Tom Riddle", 800);
            BadGuy Bellatrix = new BadGuy("Bellatrix Lestrange", 600);
            BadGuy Draco     = new BadGuy("Draco Malfoy", 400);

            Show.HorizontalDivider();

            Voldemort.steal(Harry, 200);
            Voldemort.steal(Draco, 200);
            Bellatrix.steal(Draco, 200);

            Harry.Capture(Bellatrix);
            Harry.give(Hermione, 400);
            Harry.give(Ron, 400);

            Show.HorizontalDivider();
            System.Console.ReadKey();
        }
Exemplo n.º 5
0
    void start()
    {
        battle.goodGuy.GetComponent<Button>().interactable = true;
        player = battle.goodGuy.GetComponent<GoodGuy>();
        if(battle.heroCheck.hero1)
            hero1 = battle.hero1.GetComponent<GoodGuy>();
        if(battle.heroCheck.hero2)
            hero2 = battle.hero2.GetComponent<GoodGuy>();
        if (battle.playerTurn)
        {
            if (battle.playerTurnCount == 1)
            {
                player.RadialMenuCall();
            }
            if (battle.playerTurnCount == 2)
            {
                hero1.RadialMenuCall();
            }
            if (battle.playerTurnCount == 3)
            {
                hero2.RadialMenuCall();

            }
        }

        if (battle.hasAttacked)
        {
            if (battle.badGuy.GetComponent<BadGuy>().currentHP <= 0)
                ToBattleWon();
            else
                ToEnemyTurn();

        }
    }
Exemplo n.º 6
0
 void Start()
 {
     if (null == _goodGuy)
     {
         _goodGuy = FindObjectOfType <GoodGuy>();
     }
     Assert.IsNotNull <GoodGuy>(_goodGuy);
 }
Exemplo n.º 7
0
 private void HandleDamage()
 {
     switch (CurrentState)
     {
     case State.SearchingForVictim:
         target       = GameManager.Instance.Player;
         CurrentState = State.Attacking;
         break;
     }
 }
Exemplo n.º 8
0
    private IEnumerator SearchingRoutine()
    {
        while (CurrentState == State.SearchingForVictim)
        {
            target = FindCloseEnoughTarget();

            if (target != null)
            {
                CurrentState = State.Attacking;
                yield break;
            }
            yield return(null);
        }
    }
Exemplo n.º 9
0
    private void attack()
    {
        Collider[] hitEnemies = Physics.OverlapSphere(AttackPoint.position, AttackRange, EnemyLayers);
        Collider[] hitGoodGuy = Physics.OverlapSphere(AttackPoint.position, AttackRange, GoodGuyLayers);

        foreach (Collider enemy in hitEnemies)
        {
            shopSystem.SetMoneyAmount(6f);
            FindObjectOfType <AudioManager>().Play("Slap");
            enemy.GetComponent <Enemy>().SetIsDead();
        }
        foreach (Collider GoodGuy in hitGoodGuy)
        {
            FindObjectOfType <AudioManager>().Play("Slap");
            GoodGuy.GetComponent <GoodGuy>().WrongHit();
        }
    }
Exemplo n.º 10
0
    //recieves game object information from TargetSelection script and handles damage.
    public void AttackSystem(GameObject gg, GameObject bg, bool ggAttack = false, bool bgAttack = false)
    {
        //Grab scrips from objects
        GoodGuy ggScript = gg.GetComponent <GoodGuy>();
        BadGuy  bgScript = bg.GetComponent <BadGuy>();

        if (ggAttack)
        {
            bgScript.currentHP -= ggScript.attk;
            battle.hasAttacked  = true;
        }


        if (bgAttack)
        {
            ggScript.currentHP -= bgScript.attk;
            battle.hasAttacked  = true;
        }
    }
Exemplo n.º 11
0
    private GoodGuy FindCloseEnoughTarget()
    {
        GoodGuy[] goodGuys = GameManager.Instance.TargetableGoodGuys.ToArray();

        float   closestDistance = float.PositiveInfinity;
        GoodGuy result          = null;

        for (int i = 0; i < goodGuys.Length; i++)
        {
            GoodGuy goodGuy = goodGuys[i];
            float   distance;

            if (IsCloseEnough(goodGuy.transform.position, out distance))
            {
                //Debug.Log(distance);

                if (checkRaycasts)
                {
                    Vector3 direction = goodGuy.transform.position - transform.position;
                    direction.Normalize();

                    Ray ray = new Ray(transform.position + transform.up * 3f, direction);

                    Debug.DrawRay(ray.origin, ray.direction, Color.red);
                    RaycastHit hit;

                    if (Physics.Raycast(ray, out hit, 100f, aiVisionMask))
                    {
                        continue;
                    }
                }

                if (distance < closestDistance)
                {
                    closestDistance = distance;
                    result          = goodGuy;
                }
            }
        }

        return(result);
    }
Exemplo n.º 12
0
    void start()
    {
        battle.goodGuy.GetComponent <Button>().interactable = true;
        player = battle.goodGuy.GetComponent <GoodGuy>();
        if (battle.heroCheck.hero1)
        {
            hero1 = battle.hero1.GetComponent <GoodGuy>();
        }
        if (battle.heroCheck.hero2)
        {
            hero2 = battle.hero2.GetComponent <GoodGuy>();
        }
        if (battle.playerTurn)
        {
            if (battle.playerTurnCount == 1)
            {
                player.RadialMenuCall();
            }
            if (battle.playerTurnCount == 2)
            {
                hero1.RadialMenuCall();
            }
            if (battle.playerTurnCount == 3)
            {
                hero2.RadialMenuCall();
            }
        }


        if (battle.hasAttacked)
        {
            if (battle.badGuy.GetComponent <BadGuy>().currentHP <= 0)
            {
                ToBattleWon();
            }
            else
            {
                ToEnemyTurn();
            }
        }
    }
Exemplo n.º 13
0
 public static void CaptureMessage(GoodGuy goodGuy, BadGuy badGuy, double amount)
 {
     Show.Formatted(goodGuy.Name + " captured " + badGuy.Name + " and got " + amount);
     Show.Money(goodGuy);
     Show.Money(badGuy);
 }
Exemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     player = spawnGoodGuy.GetComponent<GoodGuy>();
     enemy = SpawnBadGuy.GetComponent<BadGuy>();
     heroCheck = GameObject.Find("GameController").GetComponent<HeroCheck>();
 }
Exemplo n.º 15
0
 public static void StealMessage(BadGuy badGuy, GoodGuy goodGuy, double amount)
 {
     Show.Formatted(badGuy.Name + " stole " + amount + " from " + goodGuy.Name);
     Show.Money(badGuy);
     Show.Money(goodGuy);
 }
Exemplo n.º 16
0
 ///////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////
 private static void Money(GoodGuy goodGuy)
 {
     Show.Money(goodGuy.Name, goodGuy.Money);
 }
Exemplo n.º 17
0
 public void steal(GoodGuy goodGuy, double amount)
 {
     this.money    += amount;
     goodGuy.money -= amount;
     Show.StealMessage(this, goodGuy, amount);
 }
Exemplo n.º 18
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        public void Steal(GoodGuy goodGuy, double amount) // here's where the info enters
        {
            this.Money    += amount;                      // money added
            goodGuy.Money -= amount;                      // money subtracted
            Show.StealMessage(this, goodGuy, amount);     // parameters locked in for show class method
        }
Exemplo n.º 19
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 public void Give(GoodGuy otherGoodGuy, double amount)
 {
     otherGoodGuy.Money += amount;
     this.Money -= amount;
     Show.GiveMessage(this, otherGoodGuy, amount);
 }
Exemplo n.º 20
0
 public static void StealMessage(BadGuy badGuy, GoodGuy goodGuy, double amount)
 {
     Show.Formatted(badGuy.Name + " stole " + amount + " from " + goodGuy.Name);
     Show.Money(badGuy);
     Show.Money(goodGuy);
 }
Exemplo n.º 21
0
 // Update is called once per frame
 void Update()
 {
     player = goodGuy.GetComponent<GoodGuy>();
     enemy = badGuy.GetComponent<BadGuy>();
 }
Exemplo n.º 22
0
 public void CombatTimer()
 {
     player = goodGuy.GetComponent <GoodGuy>();
 }
Exemplo n.º 23
0
 private void Start()
 {
     guy = GameObject.Find("skimo").GetComponent <GoodGuy>();
 }
Exemplo n.º 24
0
 // Use this for initialization
 void Start()
 {
     player    = spawnGoodGuy.GetComponent <GoodGuy>();
     enemy     = SpawnBadGuy.GetComponent <BadGuy>();
     heroCheck = GameObject.Find("GameController").GetComponent <HeroCheck>();
 }
Exemplo n.º 25
0
 private static void money(GoodGuy goodGuy)
 {
     Show.money(goodGuy.name, goodGuy.money);
 }
Exemplo n.º 26
0
 public static void CaptureMessage(GoodGuy goodGuy, BadGuy badGuy, double amount)
 {
     Show.Formatted(goodGuy.Name + " captured " + badGuy.Name + " and got " + amount);
     Show.Money(goodGuy);
     Show.Money(badGuy);
 }
Exemplo n.º 27
0
 public void CombatTimer()
 {
     player = goodGuy.GetComponent<GoodGuy>();
 }
Exemplo n.º 28
0
 public static void GiveMessage(GoodGuy giver, GoodGuy receiver, double amount)
 {
     Show.Formatted(giver.Name + " gave " + amount + " to " + receiver.Name);
     Show.Money(giver);
     Show.Money(receiver);
 }
Exemplo n.º 29
0
    public void AnimationSystem()
    {
        GoodGuy playerAniamtion = GameObject.Find("Player").GetComponent <GoodGuy>();

        playerAniamtion.AttackAnimation();
    }
Exemplo n.º 30
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        private static void Money(GoodGuy goodGuy)
        {
            Show.Money(goodGuy.Name, goodGuy.Money);
        }
Exemplo n.º 31
0
 public static void GiveMessage(GoodGuy giver, GoodGuy receiver, double amount)
 {
     Show.Formatted(giver.Name + " gave " + amount + " to " + receiver.Name);
     Show.Money(giver);
     Show.Money(receiver);
 }
Exemplo n.º 32
0
 private static void Money(GoodGuy goodGuy)
 {
     Show.Money(goodGuy.Name, goodGuy.Money); // run money method w/ these parameters that auto loaded object info
 }
Exemplo n.º 33
0
 // Use this for initialization
 void Start()
 {
     playerScript   = player.GetComponentInParent <GoodGuy>();
     HPBar.maxValue = playerScript.maxHP;
 }
Exemplo n.º 34
0
 // Use this for initialization
 void Start()
 {
     playerScript = player.GetComponentInParent<GoodGuy>();
     HPBar.maxValue = playerScript.maxHP;
 }
Exemplo n.º 35
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 public void Steal(GoodGuy goodGuy, double amount)
 {
     this.Money += amount;
     goodGuy.Money -= amount;
     Show.StealMessage(this, goodGuy, amount);
 }
Exemplo n.º 36
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        public void Give(GoodGuy otherGoodGuy, double amount)
        {
            otherGoodGuy.Money += amount;
            this.Money         -= amount;
            Show.GiveMessage(this, otherGoodGuy, amount);
        }
Exemplo n.º 37
0
 // Update is called once per frame
 void Update()
 {
     player = goodGuy.GetComponent <GoodGuy>();
     enemy  = badGuy.GetComponent <BadGuy>();
 }