Exemple #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);
 }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();

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

            if (target != null)
            {
                CurrentState = State.Attacking;
                yield break;
            }
            yield return(null);
        }
    }
Exemple #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();
        }
    }
Exemple #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;
        }
    }
Exemple #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);
    }
Exemple #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();
            }
        }
    }
Exemple #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);
 }
 // Use this for initialization
 void Start()
 {
     player = spawnGoodGuy.GetComponent<GoodGuy>();
     enemy = SpawnBadGuy.GetComponent<BadGuy>();
     heroCheck = GameObject.Find("GameController").GetComponent<HeroCheck>();
 }
Exemple #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);
 }
Exemple #16
0
 ///////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////
 private static void Money(GoodGuy goodGuy)
 {
     Show.Money(goodGuy.Name, goodGuy.Money);
 }
Exemple #17
0
 public void steal(GoodGuy goodGuy, double amount)
 {
     this.money    += amount;
     goodGuy.money -= amount;
     Show.StealMessage(this, goodGuy, amount);
 }
Exemple #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
        }
Exemple #19
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 public void Give(GoodGuy otherGoodGuy, double amount)
 {
     otherGoodGuy.Money += amount;
     this.Money -= amount;
     Show.GiveMessage(this, otherGoodGuy, amount);
 }
Exemple #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);
 }
Exemple #21
0
 // Update is called once per frame
 void Update()
 {
     player = goodGuy.GetComponent<GoodGuy>();
     enemy = badGuy.GetComponent<BadGuy>();
 }
Exemple #22
0
 public void CombatTimer()
 {
     player = goodGuy.GetComponent <GoodGuy>();
 }
Exemple #23
0
 private void Start()
 {
     guy = GameObject.Find("skimo").GetComponent <GoodGuy>();
 }
Exemple #24
0
 // Use this for initialization
 void Start()
 {
     player    = spawnGoodGuy.GetComponent <GoodGuy>();
     enemy     = SpawnBadGuy.GetComponent <BadGuy>();
     heroCheck = GameObject.Find("GameController").GetComponent <HeroCheck>();
 }
Exemple #25
0
 private static void money(GoodGuy goodGuy)
 {
     Show.money(goodGuy.name, goodGuy.money);
 }
Exemple #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);
 }
Exemple #27
0
 public void CombatTimer()
 {
     player = goodGuy.GetComponent<GoodGuy>();
 }
Exemple #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);
 }
Exemple #29
0
    public void AnimationSystem()
    {
        GoodGuy playerAniamtion = GameObject.Find("Player").GetComponent <GoodGuy>();

        playerAniamtion.AttackAnimation();
    }
Exemple #30
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        private static void Money(GoodGuy goodGuy)
        {
            Show.Money(goodGuy.Name, goodGuy.Money);
        }
Exemple #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);
 }
Exemple #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
 }
Exemple #33
0
 // Use this for initialization
 void Start()
 {
     playerScript   = player.GetComponentInParent <GoodGuy>();
     HPBar.maxValue = playerScript.maxHP;
 }
Exemple #34
0
 // Use this for initialization
 void Start()
 {
     playerScript = player.GetComponentInParent<GoodGuy>();
     HPBar.maxValue = playerScript.maxHP;
 }
Exemple #35
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 public void Steal(GoodGuy goodGuy, double amount)
 {
     this.Money += amount;
     goodGuy.Money -= amount;
     Show.StealMessage(this, goodGuy, amount);
 }
Exemple #36
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        /////////////////////////////////////////////////////////////////////////////////////////////////////

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