示例#1
0
    private void OnParticleCollision(GameObject col)
    {
        float hurt = col.GetComponent <rage>().damage;

        health -= hurt;
        if (health <= 0)
        {
            Destroy(gameObject);
            GameObject obj = col.gameObject;
            wizard     wiz = obj.GetComponentInParent <wizard>();
            wiz.earn(points);
        }
    }
示例#2
0
 void OnCollisionEnter2D(Collision2D col)
 {
     Destroy(gameObject);
     if (col.gameObject.CompareTag("wizard"))
     {
         GameObject obj = col.gameObject;
         wizard     wiz = obj.GetComponent <wizard>();
         if (!wiz.anim.GetBool("defend") || obj.transform.rotation.y == transform.rotation.y)
         {
             wiz.Damage(damage);
         }
     }
 }
示例#3
0
        private void button3_Click(object sender, EventArgs e)
        {
            ArrayList L = new ArrayList();

            if (wz == wizard.dataobjects)
            {
                // MessageBox.Show("Import data objects selected");

                TreeView g = treeView1;

                foreach (TreeNode ns in g.Nodes)
                {
                    LoadNodes(ns, L);
                }

                dataSourceObjects = L;

                wz = wizard.dataobjectsready;

                MessageBox.Show("Total number of selected nodes " + L.Count.ToString());

                this.DialogResult = DialogResult.OK;

                this.Close();
            }
            else if (wz == wizard.databaseobjects)
            {
                MessageBox.Show("Import database objects selected");

                data.ns = new List <DataTable>();

                foreach (TreeNode ns in db.Nodes)
                {
                    LoadDatabaseNodes(ns, L);
                }
                wz = wizard.databaseobjectsready;

                MessageBox.Show("Total number of selected nodes " + L.Count.ToString());

                this.DialogResult = DialogResult.OK;

                this.Close();
            }
        }
示例#4
0
            public void ClassPick()
            {
                Console.WriteLine("1. Would you like to be a Wizard?\n as a mage you cast fire balls at your enemy from a far and learn a book of spells as you lvl.\n" +
                                  Environment.NewLine + "2. Would you like to be a Fighter?\n as a fighter you rely on growing powerlvl's and harness ki to do enargy blast at short range,\n  learning new fightingstyles as you lvl\n " +
                                  Environment.NewLine + "3. Would you like to be a Ninja?\n as a ninja you rely on weapons and techneues of stelth and speed to suprise your enemy and deal powerful blows.\n  as you Level you learn new hidden powers from clan leaders sent to you by scroll you steal or our taught to you by your clan.\n ");
                var ans    = Console.ReadLine();
                int choice = 0;

                if (int.TryParse(ans, out choice))
                {
                    switch (choice)
                    {
                    case 1:
                        Console.WriteLine("yess...i see it ..the magic of this place runs trough you! and that glow...its haunghting! you may become a powerful mage someday." +
                                          Environment.NewLine + "Press any kay to see your Hero Stats");
                        Console.WriteLine();
                        Console.ReadKey();

                        wizard firemage = new wizard("Russell", 1, 30f, 400, 3000, 300, schoolofmagic.Fire);
                        firemage.Print();

                        Console.WriteLine("^^comment^^ when a fire mage's attack hits, they gets a New_rage " + firemage.rage);
                        Console.WriteLine();


                        break;

                    case 2:
                        Console.WriteLine("yess...i see it ..you have the eyes of a warroir! your body is small but over time your eye..YOU EYES will drive you to become strong!" +
                                          Environment.NewLine + "Press any kay to see your Hero Stats");
                        Console.WriteLine();
                        Console.ReadKey();
                        fighter sayan = new fighter("adam", 1, 55f, 4000, 200, 3000, fightingstyles.WEST_brawler);
                        sayan.Print();
                        Console.WriteLine("^^comment^^ when a sayan's attack hits, they gets a New_rage " + sayan.rage);
                        Console.WriteLine();
                        Console.ReadKey();
                        break;

                    //something for option 2
                    case 3:
                        Console.WriteLine("yess...i see it ..you have a one-nce your shadow! would you like me to blow out some candles...i imagine a ninja is more at peace in the dark.. or maybe i should keep them on....I have many enemys I may be your target tonight." +
                                          Environment.NewLine + "Press any key to see your Hero Stats");
                        Console.WriteLine();
                        Console.ReadKey();
                        fighter ninja = new fighter("andrew", 1, 50f, 4000, 200, 3000, fightingstyles.EAST_jeet_kun_do);
                        ninja.Print();
                        Console.WriteLine("^^comment^^ when a ninja's attack hits, they gets a New_rage " + ninja.rage);
                        Console.WriteLine();

                        break;

                    //something for option 3
                    default:
                        Console.WriteLine("Wrong selection!!!" +
                                          Environment.NewLine + "Press any kay for exit");
                        Console.ReadKey();
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("You must type numeric value only!!!" +
                                      Environment.NewLine + "Press any kay for exit");
                    Console.ReadKey();
                }
            }