示例#1
0
 public static void specialDefense(fighter caster, fighter target, int cost, float scaling)
 {
     if (caster.energy > cost)
     {
         target.health += (int)(caster.potency * scaling) + (caster.potency * crit(caster.critChance)) + caster.potency;
     }
 }
示例#2
0
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (fighter == null)
     {
         fighter = animator.gameObject.GetComponent <fighter>();
     }
     fighter.body.AddRelativeForce(new Vector3(0, verticalForce, 0));
 }
示例#3
0
 public static void damageOverTime(fighter caster, fighter target, int cost, float scaling, int duration)
 {
     //-----------------------------------------------------------
     //This will be changed once turn based mechanic is added
     //-----------------------------------------------------------
     if (caster.energy > cost)
     {
         target.health -= (int)(caster.potency * scaling) + caster.potency;
     }
 }
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (Fighter == null)
     {
         Fighter = animator.gameObject.GetComponent <fighter>();
     }
     Fighter.currentState = behavoiurState;
     if (SoundEffect != null)
     {
         Fighter.playsound(SoundEffect);
     }
     Fighter.body.AddRelativeForce(new Vector3(0, verticalForce, 0));
 }
示例#5
0
 // Use this for initialization
 void Start()
 {
     health   = maxHealth;
     opponent = player.GetComponent <fighter>();
 }
示例#6
0
 //public fighter target("Target", 50, 50, 10, 10, 0.2f);
 // Use this for initialization
 void Start()
 {
     caster = new fighter("Caster", 50, 50, 10, 10, 0.2f);
     hi     = false;
     //caster.attack(target);
 }
示例#7
0
 public override void cast(fighter caster, fighter target) //base(fighter caster, fighter target)
 {
     damage_calculator.specialDefense(caster, target, cost, scaling);
 }
示例#8
0
 public override void cast(fighter caster, fighter target) //base(fighter caster, fighter target)
 {
     damage_calculator.basicAttack(caster, target, cost, scaling);
 }
示例#9
0
 public override void cast(fighter caster, fighter target) //base(fighter caster, fighter target)
 {
     damage_calculator.damageOverTime(caster, target, cost, scaling, duration);
 }
示例#10
0
 public override void cast(fighter caster, fighter target) //(fighter caster, fighter target
 {
     damage_calculator.specialAttack(caster, target, cost, scaling);
 }
示例#11
0
 public abstract void cast(fighter caster, fighter target);
示例#12
0
        private static List <fighter> buildFighters(matchstatsJson currentMatch)
        {
            List <fighter> Fighters     = new List <fighter>();
            fighter        RedFighter1  = null;
            fighter        RedFighter2  = null;
            fighter        BlueFighter1 = null;
            fighter        BlueFighter2 = null;

            if (currentMatch.p1name.Contains("/") || currentMatch.p2name.Contains("/"))
            {
                //3-4 player match
                string[] redNames        = currentMatch.p1name.Replace("'", "").Split('/');
                string[] redTotalMatches = currentMatch.p1totalmatches.Split('/');
                string[] redWinRate      = currentMatch.p1winrate.Split('/');
                string[] redTier         = currentMatch.p1tier.Split('/');
                string[] redLife         = currentMatch.p1life.Split('/');
                string[] redAuthor       = currentMatch.p1author.Split('/');
                string[] redPalette      = currentMatch.p1palette.Split('/');

                string[] blueNames        = currentMatch.p2name.Replace("'", "").Split('/');
                string[] blueTotalMatches = currentMatch.p2totalmatches.Split('/');
                string[] blueWinRate      = currentMatch.p2winrate.Split('/');
                string[] blueTier         = currentMatch.p2tier.Split('/');
                string[] blueLife         = currentMatch.p2life.Split('/');
                string[] blueAuthor       = currentMatch.p2author.Split('/');
                string[] bluePalette      = currentMatch.p2palette.Split('/');

                RedFighter1 = new fighter(redNames[0], Convert.ToInt32(redTotalMatches[0]), Convert.ToInt32(redWinRate[0]), redTier[0], Convert.ToInt32(redLife[0]), redAuthor[0], Convert.ToInt32(redPalette[0]));
                if (redNames.Count() > 1)
                {
                    RedFighter2 = new fighter(redNames[1], Convert.ToInt32(redTotalMatches[1]), Convert.ToInt32(redWinRate[1]), redTier[1], Convert.ToInt32(redLife[1]), redAuthor[1], Convert.ToInt32(redPalette[1]));
                }

                BlueFighter1 = new fighter(blueNames[0], Convert.ToInt32(blueTotalMatches[0]), Convert.ToInt32(blueWinRate[0]), blueTier[0], Convert.ToInt32(blueLife[0]), blueAuthor[0], Convert.ToInt32(bluePalette[0]));

                Fighters.Add(RedFighter1);
                if (RedFighter2 != null)
                {
                    Fighters.Add(RedFighter2);
                }
                Fighters.Add(BlueFighter1);

                if (blueNames.Count() > 1)
                {
                    BlueFighter2 = new fighter(blueNames[1], Convert.ToInt32(blueTotalMatches[1]), Convert.ToInt32(blueWinRate[1]), blueTier[1], Convert.ToInt32(blueLife[1]), blueAuthor[1], Convert.ToInt32(bluePalette[1]));
                    Fighters.Add(BlueFighter2);
                }
            }
            else
            {
                //2 player match
                string redNames        = currentMatch.p1name;
                string redTotalMatches = currentMatch.p1totalmatches;
                string redWinRate      = currentMatch.p1winrate;
                string redTier         = currentMatch.p1tier;
                string redLife         = currentMatch.p1life;
                string redAuthor       = currentMatch.p1author;
                string redPalette      = currentMatch.p1palette;

                string blueNames        = currentMatch.p2name;
                string blueTotalMatches = currentMatch.p2totalmatches;
                string blueWinRate      = currentMatch.p2winrate;
                string blueTier         = currentMatch.p2tier;
                string blueLife         = currentMatch.p2life;
                string blueAuthor       = currentMatch.p2author;
                string bluePalette      = currentMatch.p2palette;

                RedFighter1  = new fighter(redNames, Convert.ToInt32(redTotalMatches), Convert.ToInt32(redWinRate), redTier, Convert.ToInt32(redLife), redAuthor, Convert.ToInt32(redPalette));
                BlueFighter1 = new fighter(blueNames, Convert.ToInt32(blueTotalMatches), Convert.ToInt32(blueWinRate), blueTier, Convert.ToInt32(blueLife), blueAuthor, Convert.ToInt32(bluePalette));

                Fighters.Add(RedFighter1);
                Fighters.Add(BlueFighter1);
            }

            return(Fighters);
        }
示例#13
0
 void useAbility(fighter other, string moveName)
 {
     //take in fighter and ability name
     moves[moveName].cast(this, other);
 }
示例#14
0
 void attack(fighter other)
 {
     basicAttack(this, other);
 }
示例#15
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();
                }
            }
示例#16
0
 public static void basicAttack(fighter caster, fighter target, int cost = 0, float scaling = 0.0f)
 {
     target.health -= caster.strength + (caster.strength * crit(caster.critChance));
 }