當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。