当前位置: 首页>>代码示例>>C#>>正文


C# Battle类代码示例

本文整理汇总了C#中Battle的典型用法代码示例。如果您正苦于以下问题:C# Battle类的具体用法?C# Battle怎么用?C# Battle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Battle类属于命名空间,在下文中一共展示了Battle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AttackCustomWindow

 public AttackCustomWindow(Battle battle)
 {
     InitializeComponent();
     _battle = battle;
     comboBox1.ItemsSource = _battle.Members;
     comboBox2.ItemsSource = _battle.Members;
 }
开发者ID:macper,项目名称:Helper,代码行数:7,代码来源:AttackCustomWindow.xaml.cs

示例2: BattleScreen

        /// <summary>
        /// Constructor.
        /// </summary>
        public BattleScreen(Battle.BattleInfo battleInfo)
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            BattleInfo = battleInfo;
        }
开发者ID:LaudableBauble,项目名称:Insipidus,代码行数:10,代码来源:BattleScreen.cs

示例3: Think

        public Think(Battle battle)
            : base(battle)
        {
            CurrentThinkActionType = ThinkActionType.None;
            currentThinkAction = null;
            CurrentOptionNameIndex = 0;
            MenuOptions = null;
            inOuterMenu = true;
            CurrentOuterMenuOptionIndex = 0;

            weaponMenuOptions = new Dictionary<CharacterClass, List<ThinkMenuOption>>();
            foreach (CharacterClass characterClass in Enum.GetValues(typeof(CharacterClass)))
                weaponMenuOptions.Add(characterClass, new List<ThinkMenuOption>());
            shieldMenuOptions = new List<ThinkMenuOption>();
            itemMenuOptions = new List<ThinkMenuOption>();

            Actions = new List<ThinkAction>(battle.PlayerParty.Count);

            inputButtonListener = new InputButtonListener(new Dictionary<InputButton, ButtonEventHandlers> {
                { InputButton.Up, new ButtonEventHandlers(down: upHandler) },
                { InputButton.Down, new ButtonEventHandlers(down: downHandler) },
                { InputButton.Left, new ButtonEventHandlers(down: leftHandler) },
                { InputButton.Right, new ButtonEventHandlers(down: rightHandler) },
                { InputButton.A, new ButtonEventHandlers(up: selectOption) },
                { InputButton.B, new ButtonEventHandlers(up: cancelAction) }
            });
        }
开发者ID:supermaximo93,项目名称:SuperFantasticSteampunk,代码行数:27,代码来源:Think.cs

示例4: TryPerform

        public bool TryPerform(Battle context)
        {
            Debug.Assert(!IsRunning);

            if (IsBeforeDelaying)
            {
                Debug.LogError("now before delaying.");
                return false;
            }

            if (_boss.IsDead)
                return false;

            if (_boss.Data.Skills.Empty())
            {
                Debug.LogError("has no skill.");
                return false;
            }

            var data = SampleOrGetDebugSkillData(context);
            if (data == null)
                return false;

            Running = _skillFactory.Create(data, context, _boss);
            Running.OnStop += OnStop;
            Running.Start();
            Events.Boss.OnSkillStart.CheckAndCall(_boss, Running);
            return true;
        }
开发者ID:choihb,项目名称:snugdc-project-sprpg,代码行数:29,代码来源:BossAi.cs

示例5: Encounter

        public override void Encounter()
        {   
            int level = rng.Next(3, 5);
            int species = rng.Next(1, 101);

            Battle battle = new Battle();

            if (species > 65)
            {
                battle.Wild(generator.Create("Rattata", level));
            }
            else if (species > 30)
            {
                battle.Wild(generator.Create("Pidgey", level));
            }
            else if (species > 15)
            {
                battle.Wild(generator.Create("Weedle", level));
            }
            else
            {
                battle.Wild(generator.Create("Caterpie", level));
            }

            return;
        }
开发者ID:tasosgretsistas,项目名称:pokemontextgame,代码行数:26,代码来源:Route2N.cs

示例6: Interact

        public override void Interact(Entity other)
        {
            if (other is Combatant) {
                Combatant otherCombatant = (Combatant)other;

                // If interacting with an enemy
                if (!Team.IsFriendly(otherCombatant.Team)) {
                    IsEngaged = true;

                    // Join the enemy's battle, or create a new one
                    if (otherCombatant.battle == null) {
                        battle = new Battle();
                    } else {
                        battle = otherCombatant.battle;
                    }

                    // Add fighters to the battle
                    foreach (Fighter f in Fighters) {
                        battle.AddFighter(f);
                    }

                    // We want the battle to notify us when it ends,
                    // so we can disengage
                    battle.Ended += OnBattleEnd;

                    // Notify
                    JoinedBattle(this, new CombatantEventArgs {
                        Battle = battle
                    });
                }
            }
        }
开发者ID:RolandMQuiros,项目名称:LostGenerationOld,代码行数:32,代码来源:Combatant.cs

示例7: Start

	// Use this for initialization
    void Start()
    {
        //Dictionary<Storage.UnitTypes, uint> dUnits = new Dictionary<Storage.UnitTypes, uint>();
        //Dictionary<Storage.BuildingTypes, uint> dBuildings = new Dictionary<Storage.BuildingTypes, uint>();
        missionsToComplete = 0;
        GameInformation info = GameObject.Find("GameInformationObject").GetComponent<GameInformation>();
        battle = info.GetBattle();
        foreach (Battle.MissionDefinition mission in battle.GetMissions())
        {
            switch (mission.purpose)
            {
                case Battle.MissionType.DESTROY:
                    switch (mission.target)
                    {
                        case Storage.EntityType.UNIT:
                            destroyedUnitsWinners.Add(mission.targetType.unit, 0);
                            //dUnits.Add(mission.targetType.unit, mission.amount);
                            missionsToComplete++;
                            break;
                        case Storage.EntityType.BUILDING:
                            destroyedBuildingsWinners.Add(mission.targetType.building, 0);
                            //dBuildings.Add(mission.targetType.building, mission.amount);
                            missionsToComplete++;
                            break;
                    }
                    break;
            }
        }
    }
开发者ID:srferran,项目名称:ES2015A,代码行数:30,代码来源:MissionController.cs

示例8: Encounter

        public override void Encounter()
        {   
            int level = rng.Next(3, 6);
            int level2 = rng.Next(4, 7);
            int species = rng.Next(1, 101);

            Battle battle = new Battle();

            if (species > 75)
            {
                battle.Wild(generator.Create("Caterpie", level));
            }
            else if (species > 50)
            {
                battle.Wild(generator.Create("Weedle", level));
            }
            else if (species > 30)
            {
                battle.Wild(generator.Create("Pidgey", level));
            }
            else if (species > 15)
            {
                battle.Wild(generator.Create("Metapod", level2));
            }
            else
            {
                battle.Wild(generator.Create("Kakuna", level2));
            }
        }
开发者ID:tasosgretsistas,项目名称:pokemontextgame,代码行数:29,代码来源:ViridianForestPart1.cs

示例9: OnExecuteCommand

 public void OnExecuteCommand(Battle.MessageConstants.ExecuteCommandHook hook)
 {
     var executer = AllPartyManager.Instance.ActiveTimeMaxBattleCharacter;
     var selectCommandData = executer.SelectCommandData;
     selectCommandData.Impact.Damage = CalcurateDamage.Range( this.data.PowerMinToInt, this.data.PowerMaxToInt );
     selectCommandData.Impact.Target.TakeDamage( selectCommandData.Impact.Damage );
 }
开发者ID:hiroki-kitahara,项目名称:RPG,代码行数:7,代码来源:OnExecuteCommandRangeAttackFromMagicData.cs

示例10: CreateUser

 public Regulus.Project.Crystal.Game.Core CreateUser(Regulus.Remoting.ISoulBinder binder, IStorage storage, IMap zone , Battle.IZone battle)
 {
     var core = new Regulus.Project.Crystal.Game.Core(binder, storage, zone, battle);
     _Users.AddFramework(core);
     core.InactiveEvent += () => { _Users.RemoveFramework(core); };
     return core;
 }
开发者ID:jiowchern,项目名称:KeysCore,代码行数:7,代码来源:Hall.cs

示例11: MainWindow

 public MainWindow(Battle.Core.BattlelordsSession session)
     : base("Battle")
 {
     this.session = session;
     this.build();
     this.DeleteEvent += HandleHandleDeleteEvent;
 }
开发者ID:sgtnasty,项目名称:battle,代码行数:7,代码来源:MainWindow.cs

示例12: Main

        static void Main( string[] args )
        {
            Messenger.Input = Console.ReadLine;
            Messenger.Message.Subscribe( MessageWriter );

            var hero = new HeroBattler( Messenger, "勇者", 20, 20 );
            var witch = new HeroBattler( Messenger, "魔女", 18, 18 );
            var enemy = new Battler( Messenger, "スキュラ", 20, 20 );
            var enemy2 = new Battler( Messenger, "モノアイ", 16, 16 );

            var atackSkill = new Skill( "攻撃", 1, 1, Atack );
            var pluralAtackSkill = new Skill( "連続攻撃", 1, 1, PluralAtack );
            var starSkill = new Skill( "星を落とす魔法", 1, 3, StarMagic );
            var fireSkill = new Skill( "炎の剣", 2, 1, FireSlash );

            hero.AddSkill( atackSkill );
            hero.AddSkill( pluralAtackSkill );
            hero.AddSkill( fireSkill );
            witch.AddSkill( atackSkill );
            witch.AddSkill( starSkill );
            enemy.AddSkill( atackSkill );
            enemy.AddSkill( pluralAtackSkill );
            enemy2.AddSkill( atackSkill );

            var battle = new Battle( Messenger, new[] { hero, witch }, new[] { enemy, enemy2 } );
            var sub = battle.Run().ToMicrothread();
            while( sub.Current == BattleState.Fighting )
            {
                sub.Yield();
            }

            Console.WriteLine( "End" );
            Console.ReadLine();
        }
开发者ID:NumAniCloud,项目名称:BattlePrompt,代码行数:34,代码来源:Program.cs

示例13: NewCharacterWindow

 public NewCharacterWindow(Battle.Core.BattlelordsSession session)
 {
     this.session = session;
     this.SetDefaultSize(400,300);
     this.SetPosition(WindowPosition.Center);
     this.build();
 }
开发者ID:sgtnasty,项目名称:battle,代码行数:7,代码来源:NewCharacterWindow.cs

示例14: Click

    /*
    public void Click(){
        battle = GetComponentInParent<Battle>();
        Debug.Log("click Atk");
        //battle.act1 = Accion.CreateAccion("AttackGeneric");

        battle.act1 = Accion.CreateAccion(battle.userMon.GetMov(battle.userMon.lv)[0],battle.opoMon);
    }*/
    public void Click()
    {
        battle = GetComponentInParent<Battle>();
        battle.user.nroMovimiento = 0;
        battle.user.target = battle.opoMon;
        battle.user.clicks = accionesEntrenador.Ataque;
    }
开发者ID:Lex92,项目名称:Programacion-3,代码行数:15,代码来源:AttackBtn.cs

示例15: Awake

 ///////////////////////////////////////////////////////////////////////////////
 // Function
 ///////////////////////////////////////////////////////////////////////////////
 new void Awake() {
     base.Awake();
     levelName = GameLevel.Battle.ToString();
     instance = this;
     input = GetComponent<GameInput>();
     input.enabled = false;
 }
开发者ID:GavenZhou,项目名称:ProjectDemo,代码行数:10,代码来源:Battle.cs


注:本文中的Battle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。