Inheritance: ControllerBase
コード例 #1
0
    public void Awake()
    {
        desLabel = transform.Find("DesLabel").GetComponent<UILabel>();
        energyLabel = transform.Find("EnergyLabel").GetComponent<UILabel>();
        energyTitleLabel = transform.Find("EnergyTitleLabel").GetComponent<UILabel>();
        btnsignleEnter = transform.Find("BtnSignleEnter").GetComponent<UIButton>();
        btnteamEnter = transform.Find("BtnTeamEnter").GetComponent<UIButton>();

        btnClose = transform.Find("BtnClose").GetComponent<UIButton>();

        tween = transform.GetComponent<TweenScale>();

        //注册按钮点击事件
        EventDelegate ed1 = new EventDelegate(this,"OnSignleEnter");
        btnsignleEnter.onClick.Add(ed1);
        EventDelegate ed2 = new EventDelegate(this, "OnClose");
        btnClose.onClick.Add(ed2);
        EventDelegate.Set(btnteamEnter.onClick, () =>
        {
            OnteamEnter();
        });
        battleController = GameManger._instance.GetComponent<BattleController>();

        battleController.OnGetTeam += this.OnGetTeam;
        battleController.OnWaitTeam += this.OnWaitTeam;
        battleController.OnCancelTeam += this.OnCancelTeam;
    }
コード例 #2
0
ファイル: PlayerAttack.cs プロジェクト: vin120/TaiDou
    private bool isSyncPlayerAnimation = false; //表示是否需要同步动画

	void Start()
    {
        player = GetComponent<Player>();
	    if (GameController.Instance.battleType == BattleType.Team && player.roleID == PhotonEngine.Instance.role.ID) //当前角色属于当前客户端
	    {
	        battleController = GameController.Instance.GetComponent<BattleController>();
	        isSyncPlayerAnimation = true;
	    }

	    hp = PlayerInfo._instance.HP;
		PlayerEffect[] peArray = this.GetComponentsInChildren<PlayerEffect>();
		foreach(PlayerEffect pe in peArray)
		{
			effectDict.Add(pe.gameObject.name,pe);
		}

		foreach(PlayerEffect pe in effectArray)
		{
			effectDict.Add(pe.gameObject.name,pe);
		}

		anim = this.GetComponent<Animator>();
		damageShowPoint = transform.Find("DamageShowPoint");
		hudTextGameObject = HpBarManager._instance.GetHudText(damageShowPoint.gameObject);
		hudText = hudTextGameObject.GetComponent<HUDText>();

	}
コード例 #3
0
ファイル: Player2Controller.cs プロジェクト: AbsoluTz/TCC-H-G
 public void Init(BattleController controller)
 {
     mao = new List<GameObject>();
     deckObj = new List<GameObject> ();
     deck = new List<string>();
     for (int i = 0; i < 30; i++)
     {
         int random = (Random.Range(0, 11));
         deck.Add("Carta" + random);
     }
     for (int i = 0; i < 4; i++)
     {
         DrawCard();
     }
     for (int i = 0; i < 26; i++)
     {
         DrawCardDeck();
     }
     OrganizeCards();
     if (controller.quemComeca == 1)
     {
         controller.quemComeca = 5;
         suaVez = !suaVez;
         StartCoroutine(Example());
         //DrawCard();
     }
     //OrganizeCards();
 }
コード例 #4
0
ファイル: TranscriptMapUI.cs プロジェクト: vin120/TaiDou
    private void Start()
    {
	    battleController = GameController.Instance.GetComponent<BattleController>();
        battleController.OnWaitingTeam += this.OnWaitingTeam;
        battleController.OnCancelTeam += this.OnCancelTeamSuccess;
        battleController.OnGetTeam += this.OnGetTeam;
    }
コード例 #5
0
 void doubleDamage(BattleController battle)
 {
     // just like a basic attack but deals double basic damage
     battle.enemyData.hitPoints -= battle.playerData.calcDamage(battle.enemyData, 2);
     battle.animateEnemy(Anims.HURT);
     battle.animatePlayer(Anims.ATTACK);
 }
コード例 #6
0
ファイル: GameManger.cs プロジェクト: 1510649869/ARPG_project
 public void Awake()
 {
     _instance = this;
     DontDestroyOnLoad(this.gameObject);
     playerController = this.GetComponent<PlayerController>();
     playerController.OnGetPlayerList += this.OnGetPlayerList;
     //playerController.GetPlayerList();
     pos=GameObject.Find("spawnPos");
     string prefabname = "Player-gril";
     if(PhotonEngine.Instance.role!=null)
     {
         if (PhotonEngine.Instance.role.Isman)
             prefabname = "Player-boy";
     }
     GameObject playeGo = GameObject.Instantiate(Resources.Load<GameObject>("player/" + prefabname))as GameObject;
     playeGo.AddComponent<TouchControl>();
     playeGo.transform.position = pos.transform.position;
     player = playeGo;
     playeGo.GetComponent<PlayerMove>().isCanController = true;
     battleController = this.GetComponent<BattleController>();
     inventoryController = this.GetComponent<InventoryItemDBController>();
     battleController.OnAsyncPostionAndRotation += this.OnAsyncPostionAndRotation;
     battleController.OnAsyncPlayerMoveAnimation += this.OnAsyncPlayerMoveAnimation;
     battleController.OnSyncPlayerAnimation += this.OnSyncPlayerAnimation;
     inventoryController.GetShopInventoryList();
 }
コード例 #7
0
 void Start()
 {
     _controller = GameObject.FindObjectOfType<BattleController>();
     if (!_controller) {
         Debug.LogError("TileSelector could not find a BattleController to send mouse notifications to");
     }
 }
コード例 #8
0
ファイル: S606Puppeteer.cs プロジェクト: metanymie/jga
	// Use this for initialization
	void Start () {
		// get all the objects we'll need for the cutscene 
		LMFB = GameObject.Find ("LMFB");
		Daria = GameObject.Find ("Daria");
		mus = GameObject.Find ("BGM").GetComponent<MusicPlayer>();
		bc = GetComponent<BattleController>();

	}
コード例 #9
0
ファイル: S301Puppeteer.cs プロジェクト: metanymie/jga
	// Use this for initialization
	void Start () {
		mp = GameObject.Find("BGM").GetComponent<MusicPlayer>();
		bc = GameObject.Find ("Scripts").GetComponent<BattleController>();

		chefTony = GameObject.Find ("Chef Tony");
		ff = GameObject.Find ("Father Flanagan");
		os = GameObject.Find ("Orphan Shield");
		shoes = GameObject.Find ("ShoesTie");
	}
コード例 #10
0
 //---------------------------------------------------------------------------------------------------------------------------------
 void healother(BattleController battle)
 {
     // the char can heal others (only the enemy for now)
     battle.enemyParticles.Play();
     battle.enemyData.hitPoints += battle.enemyData.maxHitPoints*0.2f;
     if (battle.enemyData.hitPoints > battle.enemyData.maxHitPoints){
         battle.enemyData.hitPoints = battle.enemyData.maxHitPoints;
     }
 }
コード例 #11
0
 void healSelfOpponent(BattleController battle)
 {
     // this power allows the Lion to heal itself
     battle.enemyParticles.Play();
     battle.enemyData.actionPoints--;
     battle.enemyData.hitPoints += battle.enemyData.maxHitPoints*0.05f;
     if (battle.enemyData.hitPoints > battle.enemyData.maxHitPoints){
         battle.enemyData.hitPoints = battle.enemyData.maxHitPoints;
     }
 }
コード例 #12
0
 void Start()
 {
     anim = this.GetComponent<Animator>();
     player = GetComponent<Player>();
     if (GameManger._instance.battleType == BattleType.Team && PhotonEngine.Instance.role.ID == player.roleID)
     {
         battleController = GameManger._instance.GetComponent<BattleController>();
         isSyncPlayerAnimation = true;
     }
 }
コード例 #13
0
 void attack(BattleController battle)
 {
     // Basic attack
     battle.enemyData.lastDamageReceived = battle.playerData.calcDamage(battle.enemyData, 1);
     battle.playerData.lastDamageDealt = battle.enemyData.lastDamageReceived;
     battle.enemyData.hitPoints -= battle.enemyData.lastDamageReceived;
     battle.animateEnemy(Anims.HURT);
     battle.animatePlayer(Anims.ATTACK);
     AudioMaster.instance.audioSource.PlayOneShot(battle.playerWorldObject.GetComponent<MapObjectCarrier>().audioObject.attack);
 }
コード例 #14
0
 void Revenge(BattleController battle)
 {
     // Attack that deals more damage when low on HP
     battle.enemyData.lastDamageReceived = battle.enemyData.lastDamageDealt;
     battle.playerData.lastDamageDealt = battle.enemyData.lastDamageReceived;
     battle.enemyData.hitPoints -= battle.enemyData.lastDamageReceived;
     battle.animateEnemy(Anims.HURT);
     battle.animatePlayer(Anims.SPATTACK);
     AudioMaster.instance.audioSource.PlayOneShot(battle.playerWorldObject.GetComponent<MapObjectCarrier>().audioObject.spattack);
 }
コード例 #15
0
ファイル: PlayerAnimation.cs プロジェクト: vin120/TaiDou
    private bool isSyncPlayerAnimation = false; //表示是否需要同步动画

	void Start()
    {
        player = GetComponent<Player>();
        if (GameController.Instance.battleType == BattleType.Team && player.roleID == PhotonEngine.Instance.role.ID) //当前角色属于当前客户端
        {
            battleController = GameController.Instance.GetComponent<BattleController>();
            isSyncPlayerAnimation = true;
        }
		anim = this.GetComponent<Animator>();
	    playerAttack = GetComponent<PlayerAttack>();
	}
コード例 #16
0
 void attackOpponentFinal(BattleController battle)
 {
     // this is a very powerful attack, deals 4x basic damage
     battle.enemyData.actionPoints--;
     battle.playerData.lastDamageReceived = battle.enemyData.calcDamage(battle.playerData, 4);
     battle.enemyData.lastDamageDealt = battle.playerData.lastDamageReceived;
     battle.playerData.hitPoints -= battle.playerData.lastDamageReceived;
     battle.animateEnemy(Anims.SPATTACK);
     battle.animatePlayer(Anims.HURT);
     AudioMaster.instance.audioSourceEnemies.PlayOneShot(battle.enemyWorldObject.GetComponent<MapObjectCarrier>().audioObject.spattack);
 }
コード例 #17
0
ファイル: S609Puppeteer.cs プロジェクト: metanymie/jga
	// Use this for initialization
	void Start () {
		// get all the objects we'll need for the cutscene 
		//FlyingBBall = GameObject.Find ("Flying Basketball");
		ScreenFlash = GameObject.Find ("ScreenFlash").GetComponent<ScreenFlasher>();
		ExplosionFlare = GameObject.Find ("Explosion_Flare").GetComponent<LensFlare>();
		SparkParticles = GameObject.Find ("SparkParticles").GetComponent<ParticleSystem>();

		mus = GameObject.Find ("BGM").GetComponent<MusicPlayer>();
		bc = GetComponent<BattleController>();

	}
コード例 #18
0
ファイル: S607Puppeteer.cs プロジェクト: metanymie/jga
	// Use this for initialization
	void Start () {
		// get all the objects we'll need for the cutscene 
		LMFB = GameObject.Find ("LMFB");
		James = GameObject.Find ("James");
		Gasplosion = GameObject.Find ("Gasplosion");
		HatGlow = GameObject.Find ("Hat_Glow");
		ScreenFlash = GameObject.Find ("ScreenFlash");
		mus = GameObject.Find ("BGM").GetComponent<MusicPlayer>();
		bc = GetComponent<BattleController>();

	}
コード例 #19
0
 void determineAction(BattleController battle)
 {
     if (battle.enemyData.hitPoints / battle.enemyData.maxHitPoints <= 0.4f && battle.enemyData.actionPoints >= 1)
     {
         battle.enemyAction = Action.FINALATTACK;
     }
     else
     {
         battle.enemyAction = Action.ATTACK;
     }
 }
コード例 #20
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (GUILayout.Button("Create hero cards"))
            {
                Settings.main = FindObjectOfType <PuzzleSettings>();
                BattleController controller = target as BattleController;
                controller.data = controller.GetComponent <BattleData>();
                controller.CreateHeroCards();
            }
        }
コード例 #21
0
 private void Start()
 {
     _manager = FindObjectOfType <BattleController>();
     _manager.AddPlayer(gameObject);
     _phy            = gameObject.GetComponent <CustomPhysics>();
     _col            = gameObject.GetComponent <SphereCollider>();
     _normalState    = new NormalState(_speed, _maxVel, _rotateSpeed, _mesh);
     _boostingState  = new BoostingState(_boostTime, _boostMaxSpeed, _mesh);
     _runPUState     = new RunPowerUpState(_runPUTime, _speed * _runPUSpeedMultiplier, _rotateSpeed, _mesh);
     _currentState   = _normalState;
     _currentPowerUp = new NoPowerUp();
 }
コード例 #22
0
        public void Execute(BattleController battle)
        {
            foreach (GameObject monsterGameObject in battle.PlayerCharacter.Monsters)
            {
                monsterGameObject.GetComponent <MonsterController>().SetHealth();
            }

            foreach (GameObject monsterGameObject in battle.EnemyCharacter.Monsters)
            {
                monsterGameObject.GetComponent <MonsterController>().SetHealth();
            }
        }
コード例 #23
0
ファイル: PlayerMove.cs プロジェクト: vin120/TaiDou
	void Start()
	{
		anim = this.GetComponent<Animator>();
	    playerAttack = this.GetComponent<PlayerAttack>();

	    if (GameController.Instance.battleType == BattleType.Team && isCanControl)
	    {
	        battleController = GameController.Instance.GetComponent<BattleController>();
            InvokeRepeating("SyncPositionAndRotation",0,1f/30f);
            InvokeRepeating("SyncMoveAnimation",0,1f/30f);
	    }
	}
コード例 #24
0
        private SmartEntity DeployHero(TroopTypeVO troopType)
        {
            if (Service.Get <SimTimeEngine>().IsPaused())
            {
                return(null);
            }
            if (!this.CanDeploy)
            {
                return(null);
            }
            BattleController battleController = Service.Get <BattleController>();

            if (battleController.BattleEndProcessing)
            {
                return(null);
            }
            if (battleController.GetPlayerDeployableHeroCount(troopType.Uid) == 0)
            {
                this.CanDeploy = false;
                Service.Get <EventManager>().SendEvent(EventId.TroopNotPlacedInvalidTroop, this.currentWorldPosition);
                return(null);
            }
            TeamType teamType = TeamType.Attacker;

            if (battleController.GetCurrentBattle().Type == BattleType.PveDefend)
            {
                teamType = TeamType.Defender;
            }
            IntPosition     intPosition     = Units.WorldToBoardIntDeployPosition(this.currentWorldPosition);
            TroopController troopController = Service.Get <TroopController>();

            if (battleController.GetCurrentBattle().IsRaidDefense())
            {
                Entity             entity    = null;
                BoardCell <Entity> boardCell = null;
                if (!troopController.FinalizeSafeBoardPosition(troopType, ref entity, ref intPosition, ref boardCell, TeamType.Attacker, TroopSpawnMode.Unleashed, false))
                {
                    Service.Get <EventManager>().SendEvent(EventId.TroopNotPlacedInvalidArea, intPosition);
                    return(null);
                }
            }
            SmartEntity smartEntity = troopController.SpawnHero(troopType, teamType, intPosition, false);

            if (smartEntity != null)
            {
                base.PlaySpawnEffect(smartEntity);
                this.CanDeploy = false;
                battleController.OnHeroDeployed(troopType.Uid, teamType, intPosition);
                Service.Get <EventManager>().SendEvent(EventId.HeroDeployed, smartEntity);
            }
            return(smartEntity);
        }
コード例 #25
0
        public async Task <IHttpActionResult> StartGame(StartGameApiModel apiModel)
        {
            var battleController = new BattleController();
            var gamestate        = battleController.GetNewGameState();
            var p1Url            = await GetPlayerUrl(apiModel.P1Id);

            var p2Url = await GetPlayerUrl(apiModel.P2Id);

            Game game = GetGame(gamestate, p1Url, p2Url, apiModel.Seed);

            HttpContext.Current.Cache.Add(gamestate.GameId, game, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 0, 10, 0), CacheItemPriority.High, null);
            return(Ok(gamestate));
        }
コード例 #26
0
    public virtual bool CanAttack(BattleController bc)
    {
        //check the battle controller for the type and if it is allowed to attack
        var canAttack = partyType == Party.PartyType.Enemy ? bc.enemyCanAttack : bc.partyCanAttack;

        if (log)
        {
            Debug.Log(data.displayName + " canAttack " + canAttack);
        }

        //TODO: may have to revist this.
        return(characterState == CHARACTER_STATE.Idle && canAttack);
    }
コード例 #27
0
 public override void AddToGame(Game game)
 {
     this.entityController           = Service.EntityController;
     this.battleController           = Service.BattleController;
     this.troopAbilityController     = Service.TroopAbilityController;
     this.audioManager               = Service.AudioManager;
     this.specialAttackController    = Service.SpecialAttackController;
     this.squadTroopAttackController = Service.SquadTroopAttackController;
     this.buildingNodeList           = this.entityController.GetNodeList <BuildingNode>();
     this.troopNodeList              = this.entityController.GetNodeList <TroopNode>();
     this.audioResetDeltaMax         = ((!HardwareProfile.IsLowEndDevice()) ? 33u : 330u);
     this.audioResetDeltaAccumulator = this.audioResetDeltaMax;
 }
コード例 #28
0
ファイル: Battle.cs プロジェクト: psywombats/solochara
    // === INITIALIZATION===========================================================================

    public void SetUpWithController(BattleController controller)
    {
        this.controller = controller;
        this.r          = new System.Random();

        foreach (Unit baseUnit in initialUnits)
        {
            Unit unit = baseUnit.unique ? UnitFromKey(baseUnit.name) : Instantiate(baseUnit);
            AddUnit(new BattleUnit(unit, this));
        }

        ai.ConfigureForBattle(this);
    }
コード例 #29
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Debug.Log("More than 1 instance " + this.GetType().ToString());
         Destroy(this);
     }
     playerUnits = UnitList.instance;
 }
コード例 #30
0
    void Awake()
    {
        BC           = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <BattleController>();
        ESM          = GetComponent <EnemyStateMachine>();
        currentState = GaugeState.INCREASING;


        GameObject tickWindow = GameObject.FindGameObjectWithTag("TickWindow");

        transform.SetParent(tickWindow.transform);
        rectTransform           = GetComponent <RectTransform>();
        transform.localPosition = new Vector2(windowMinBound, 0);
    }
コード例 #31
0
 public void Revert(BattleController battleController)
 {
     for (int x = 0; x < Keyboard.KeyboardColumns; x++)
     {
         for (int y = 0; y < Keyboard.KeyboardRows; y++)
         {
             if (battleController.Keyboard.Runas[x, y].Element == Element && battleController.Keyboard.Runas[x, y].PoweredUp)
             {
                 battleController.Keyboard.Runas[x, y].SetPoweredUp(false);
             }
         }
     }
 }
コード例 #32
0
    private void Awake()
    {
        DOTween.Init();

        battleController = FindObjectOfType <BattleController>();
        battleController.OnTurnValueChangedEvent  += UpdateTurnUI;
        battleController.OnPlayerInfoChangedEvent += UpdatePlayerUI;
        battleController.OnBattleOverEvent        += OnBattleOver;
        fadeController = new FadeController();

        continueButton.interactable = false;
        summaryPanel.gameObject.SetActive(false);
    }
コード例 #33
0
 void Start()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         Instance = this;
     }
     characters.Add(0, new List <Character>());
     characters.Add(1, new List <Character>());
 }
コード例 #34
0
        public void UserShouldHaveValidAttack()
        {
            var user = new User
            {
                Agility  = 5,
                Stamina  = 5,
                Strength = 5
            };

            var attack = BattleController.CalculateUserAttack(user);

            Assert.AreEqual(25, attack);
        }
コード例 #35
0
 void Run()
 {
     if (_core == null)
     {
         _core = Camera.main.GetComponent <MainCore>();
     }
     if (_battleCon == null)
     {
         _battleCon = _core._battleCon;
     }
     _battleCon.GetHeroFocus()._eventBonusDmg = 1;
     _battleCon.GetMonFocus()._eventBonusDmg  = 1;
 }
コード例 #36
0
    //------------------------------------------------------------------------------------------------------------------------------
    public void CheckGameState(State state)
    {
        string stateName = state.ToString();

        switch (stateName)
        {
        case "explore":
            //Fades in Placeholder
            Color tmp = textInput.inputField.placeholder.GetComponent <CanvasRenderer>().GetColor();
            tmp.a = 1f;
            textInput.inputField.placeholder.GetComponent <CanvasRenderer>().SetColor(tmp);
            textInput.inputField.interactable = true;
            textInput.inputField.Select();
            Debug.Log("Exploring");
            ClearLoggedText();
            DisplayPhoto();
            DisplayRoomText();
            DisplayLoggedText();
            break;

        case "pause":
            //Book is lowered
            break;

        case "battle":
            //Fades out Placeholder
            Color tmp2 = textInput.inputField.placeholder.GetComponent <CanvasRenderer>().GetColor();
            tmp2.a = 0f;
            textInput.inputField.placeholder.GetComponent <CanvasRenderer>().SetColor(tmp2);
            textInput.inputField.interactable = false;     //causing problems with optionInput
            display.sprite = null;
            Debug.Log("Attacking");


            BattleController currentCombat = Instantiate(battleController, new Vector3(0, 0, 0), Quaternion.identity);
            currentCombat.controller       = this;
            currentCombat.playerController = playerController;
            ClearLoggedText();
            break;

        case "talk":
            Debug.Log("Talking!");
            ClearLoggedText();
            break;

        case "death":
            Debug.Log("You died");
            ClearLoggedText();
            break;
        }
    }
コード例 #37
0
ファイル: Kate.cs プロジェクト: dachongqing/Assets0.2
    // Use this for initialization
    void Start()
    {
        roomContraller   = FindObjectOfType <RoomContraller>();
        diceRoll         = FindObjectOfType <DiceRollCtrl>();
        eventController  = FindObjectOfType <EventController>();
        roundController  = FindObjectOfType <RoundController>();
        battleController = FindObjectOfType <BattleController>();
        //duiHuaUImanager = FindObjectOfType<DuiHuaUImanager>();
        charaInfoManager = FindObjectOfType <CharaInfoManager>();
        setGuangBoListener(FindObjectOfType <GuangBoListener>());
        guangBoController = FindObjectOfType <GuangBoController>();
        storyController   = FindObjectOfType <StoryController>();
        bss = new BlackSignStory();
        this.setName(SystemConstant.P4_NAME);
        setDistance(-0.5f);
        //游戏一开始 所处的房间 默认房间的坐标为 0,0,0
        int[] roomXYZ;
        setBag(new Bag());
        if (this.neworLoad)
        {
            roomXYZ = new int[] { 0, 0, RoomConstant.ROOM_Z_GROUND };
            setCrazyFlag(false);
            setAbilityInfo(new int[] { 8, 3, 6, 7 });
            setMaxAbilityInfo(new int[] { 8, 3, 6, 7 });
            setActionPointrolled(false);
            setIsDead(false);


            this.setDesc("看似小萝莉,其实是一个出名的侦探。");
            this.waitPlan = false;
            setTargetChara(new List <string>());
            getTargetChara().Add(SystemConstant.P2_NAME);
            //  this.setClickMessage(new string[] { "真相只有一个。", "你就是犯人。" });
            getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_SURGERY));
            getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_TRI_OPERATION));
            getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_MORGUE));
            getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_STORE));
        }
        else
        {
            P0 p = loadInfo(this.getName());
            roomXYZ       = p.Xyz;
            this.waitPlan = p.WaitPlan;
            loadInfo(this, p, roomContraller);
        }
        setCurrentRoom(roomXYZ);
        this.roomContraller.findRoomByXYZ(roomXYZ).setChara(this);
        this.roomContraller.setCharaInMiniMap(roomXYZ, this, true);
        //this.setClickMessage(this.roomContraller.findRoomByXYZ(roomXYZ).findSomethingNews(this).ToArray());
        // setBoss(true);
    }
コード例 #38
0
    /* Handle party member menu activations.
     * Updates selected entity and sets GUI state.
     * Resets menu maps as necessary.
     */
    void OnMouseUp()
    {
        BattleController battleController = partyController.UnitController.BattleController;

        switch (battleController.GUIController.GuiState)
        {
        case Utils.GUIState.PartyTurnDefault:
        case Utils.GUIState.ActionMenu:
            if (Health == 0)
            {
                Debug.Log("This unit is downed");
                break;
            }
            else if (Tapped)
            {
                Debug.Log("This unit is tapped");
                break;
            }

            battleController.TerrainController.GroundController.groundGraph.ResetMoveMap();
            battleController.TerrainController.GroundController.ResetAllTileColors();
            battleController.TerrainController.GroundController.groundGraph.ResetAttackMap();
            battleController.TerrainController.GroundController.ResetAllTileColors();
            battleController.SetActiveSelection(this);
            battleController.GUIController.GuiState = Utils.GUIState.ActionMenu;
            break;

        case Utils.GUIState.MoveMenu:
            if (battleController.ActiveSelection == this)
            {
                battleController.SetActiveSelection(EntityController.Empty);
                battleController.GUIController.GuiState = Utils.GUIState.PartyTurnDefault;
                battleController.TerrainController.GroundController.groundGraph.ResetMoveMap();
                battleController.TerrainController.GroundController.ResetAllTileColors();
            }
            break;

        case Utils.GUIState.AttackMenu:
            if (battleController.ActiveSelection == this)
            {
                battleController.SetActiveSelection(EntityController.Empty);
                battleController.GUIController.GuiState = Utils.GUIState.PartyTurnDefault;
                battleController.TerrainController.GroundController.groundGraph.ResetAttackMap();
                battleController.TerrainController.GroundController.ResetAllTileColors();
            }
            break;

        default:
            break;
        }
    }
コード例 #39
0
 public static IPowerUp Create(PowerUpType powerUpType, BattleController battleController)
 {
     if (powerUpType == PowerUpType.Potion)
     {
         return(new PotionPowerUp());
     }
     else if (powerUpType == PowerUpType.Air)
     {
         return new AtackPowerUp()
                {
                    Element = EnumElement.Air, Expiration = 3
                }
     }
     ;
     else if (powerUpType == PowerUpType.Earth)
     {
         return new AtackPowerUp()
                {
                    Element = EnumElement.Earth, Expiration = 3
                }
     }
     ;
     else if (powerUpType == PowerUpType.Fire)
     {
         return new AtackPowerUp()
                {
                    Element = EnumElement.Fire, Expiration = 3
                }
     }
     ;
     else if (powerUpType == PowerUpType.Light)
     {
         return new AtackPowerUp()
                {
                    Element = EnumElement.Light, Expiration = 3
                }
     }
     ;
     else if (powerUpType == PowerUpType.Water)
     {
         return new AtackPowerUp()
                {
                    Element = EnumElement.Water, Expiration = 3
                }
     }
     ;
     else
     {
         return(null);
     }
 }
コード例 #40
0
 private void Start()
 {
     if (Instance != null && Instance != this) // to protect from having two instances of BattleController which would confuse our references
     {
         Destroy(this.gameObject);
     }
     else
     {
         Instance = this;
     }
     characters.Add(0, new List <Character>());
     characters.Add(1, new List <Character>());
     FindObjectOfType <BattleLauncher>().Launch();
 }
コード例 #41
0
 void healself(BattleController battle)
 {
     // the char heals himself
     battle.playerParticles.Play();
     battle.playerParticles.Stop();
     battle.animateEnemy(Anims.HURT);
     battle.animatePlayer(Anims.NONE);
     battle.playerData.lastDamageDealt = 0;
     battle.enemyData.lastDamageReceived = 0;
     battle.playerData.hitPoints += battle.playerData.maxHitPoints * 0.3f;
     if (battle.playerData.hitPoints > battle.playerData.maxHitPoints){
         battle.playerData.hitPoints = battle.playerData.maxHitPoints;
     }
 }
コード例 #42
0
        public void BattleClassReturnsStructwithNonNullScore()
        {
            Queue <Fighter> charQueue = new Queue <Fighter>();

            for (int i = 0; i < 4; i++)
            {
                charQueue.Enqueue(new Character(10, 10, 5 + i, i + 1, 10, 0));
            }

            BattleController testBattle = new BattleController(charQueue);
            Results          testResult = testBattle.initBattle();

            Assert.IsNotNull(testResult.points);
        }
コード例 #43
0
ファイル: BenMonster.cs プロジェクト: dachongqing/Assets0.2
    // Use this for initialization
    public override void init()
    {
        Debug.Log("monster init function start begin...");
        roomContraller   = FindObjectOfType <RoomContraller>();
        diceRoll         = FindObjectOfType <DiceRollCtrl>();
        eventController  = FindObjectOfType <EventController>();
        roundController  = FindObjectOfType <RoundController>();
        battleController = FindObjectOfType <BattleController>();
        //duiHuaUImanager = FindObjectOfType<DuiHuaUImanager>();
        charaInfoManager = FindObjectOfType <CharaInfoManager>();
        setGuangBoListener(FindObjectOfType <GuangBoListener>());
        guangBoController = FindObjectOfType <GuangBoController>();
        storyController   = FindObjectOfType <StoryController>();
        this.setName(SystemConstant.MONSTER1_NAME);
        //游戏一开始 所处的房间 默认房间的坐标为 0,0,0
        //int[] roomXYZ = { 0, 0, RoomConstant.ROOM_Z_GROUND };
        setDistance(-1.5f);



        setAbilityInfo(new int[] { 7, 7, 1, 1 });

        setMaxAbilityInfo(new int[] { 7, 7, 1, 1 });
        setActionPointrolled(false);
        setIsDead(false);

        Character martin = roundController.getCharaByName(SystemConstant.P5_NAME);
        Character nolan  = roundController.getCharaByName(SystemConstant.P1_NAME);
        Character jessie = roundController.getCharaByName(SystemConstant.P3_NAME);
        Character player = roundController.getCharaByName(SystemConstant.P6_NAME);

        if (martin != null && !martin.isDead())
        {
            targetList.Enqueue(martin);
        }

        if (nolan != null && !nolan.isDead())
        {
            targetList.Enqueue(martin);
        }

        if (jessie != null && !jessie.isDead())
        {
            targetList.Enqueue(jessie);
        }
        if (player != null && !player.isDead())
        {
            targetList.Enqueue(player);
        }
    }
コード例 #44
0
	/**
	 * Runs at load time
	 */
	void Start () {
		battleController = BattleController.S;
		disabledTileController = DisabledTileController.S;
		gameController = GameController.S;
		highlightsController = HighlightsController.S;
		mapsController = MapsController.S;
		movementController = MovementController.S;
		navController = NavController.S;
		playerController = PlayerController.S;
		resourceTileController = ResourceTileController.S;
		tilesController = TilesController.S;
		turnsController = TurnsController.S;
		unitsController = UnitsController.S;
	}
コード例 #45
0
 static int ReqAddBot(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         BattleController obj = (BattleController)ToLua.CheckObject(L, 1, typeof(BattleController));
         obj.ReqAddBot();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #46
0
    public void Start()
    {
        if (battleController == null)
        {
            battleController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <BattleController>();
        }

        PauseMenu = Instantiate(Resources.Load <GameObject>("Menu/PauseMenuPrefab"), battleController.canvasRect.transform);
        Canvas canvas = PauseMenu.GetComponent <Canvas>();

        canvas.overrideSorting = true;
        canvas.sortingOrder    = 20;
        PauseMenu.SetActive(false);
    }
コード例 #47
0
    private IEnumerator LoadBattle()
    {
        Destroy(GameObject.Find("Canvas: Battle"));
        AsyncOperation async = SceneManager.LoadSceneAsync(2, LoadSceneMode.Additive);

        yield return(async);

        bc = GameObject.Find("Canvas: Battle").GetComponent <BattleController>();
        yield return(StartCoroutine(bc.StartBattle(bo)));

        SceneManager.UnloadScene(2);
        Destroy(GameObject.Find("Canvas: Battle"));
        yield return(new WaitForEndOfFrame());
    }
コード例 #48
0
 public void Apply(BattleController battleController)
 {
     for (int x = 0; x < Keyboard.KeyboardColumns; x++)
     {
         for (int y = 0; y < Keyboard.KeyboardRows; y++)
         {
             if (battleController.Keyboard.Runas[x, y].Element == Element && !battleController.Keyboard.Runas[x, y].PoweredUp)
             {
                 battleController.Keyboard.Runas[x, y].SetPoweredUp(true);
             }
         }
     }
     Expiration -= 1;
 }
コード例 #49
0
        public void BattleQueueisSorted()
        {
            Queue <Fighter> charQueue = new Queue <Fighter>();

            for (int i = 0; i < 4; i++)
            {
                charQueue.Enqueue(new Character(10, 10, 5 + i, i + 1, 10, 0));
            }

            BattleController testBattle = new BattleController(charQueue);
            bool             isSorted   = testBattle.testSetOrder();

            Assert.IsTrue(isSorted);
        }
コード例 #50
0
 //return true if there is a transition, false otherwise
 public override void CheckForStateAndChange(BattleController controller, string action)
 {
     if (action == BattleController.ACTION_AGREE)
     {
         string skillName = menuOption[selectedMenuOption];
         var    summon    = controller.GetCharacterSummons().Where(d => d.Name == skillName).FirstOrDefault();
         controller.sSelectTarget.SetUp(controller.GetCurrentCharacter(), summon, controller);
         controller.CurrentState = controller.sSelectTarget;
     }
     if (action == BattleController.ACTION_BACK)
     {
         controller.CurrentState = controller.sFightMenu;
     }
 }
コード例 #51
0
        public override void Construct(BattleManager battleManager, Map map, BattleController currentBattleController)
        {
            this.battleManager           = battleManager;
            this.map                     = map;
            this.currentBattleController = currentBattleController;
            mainUI = battleManager.mainUI;

            currentCharControl             = (CharacterBattleController)currentBattleController;
            _currentCharacterDataComponent = currentCharControl.characterDataComponent;

            currentCharControl.DeltaAPRed(2);

            initiated = true;
        }
コード例 #52
0
 void executeAction(BattleController battle)
 {
     switch(battle.enemyAction){ // always remember to add new actions BELOW and in BattleController.js
         case Action.ATTACK :
             attack(battle);
             break;
         case Action.FINALATTACK :
             attackOpponentFinal(battle);
             break;
         case Action.HEAL :
             healSelfOpponent(battle);
             break;
     }
 }
コード例 #53
0
        public override void Init(IModule module)
        {
            base.Init(module);

            BattleView viewScript = (BattleView)InstantiateView <BattleView>("Battle/Prefabs/BattleView");

            RegisterView(viewScript);

            controller      = new BattleController();
            controller.view = viewScript;
            RegisterController(controller);

            HideBackBtn();
        }
コード例 #54
0
ファイル: BattleController.cs プロジェクト: tombo119/Persona
    void Start()
    {
        battleController = this;

        //Create Player and Enemy
        Player = createPlayer("Player", green, 5, 40);
        Enemy = createPlayer("Enemy", red, 0, 20);
        Dick = createPlayer("Dickbutt", red, 2, 100);

        //Add to turnOrder List
        turnOrder.insert(Player, 10);
        turnOrder.insert(Enemy, 20);
        turnOrder.insert(Dick, 20);

    }
コード例 #55
0
ファイル: GameController.cs プロジェクト: vin120/TaiDou
 private void Awake()
 {
     _instance = this;
     DontDestroyOnLoad(this.gameObject);
     Transform posTransform = GameObject.Find("Player-pos").transform;
     string playerPrefabName = "Player-girl";
     if (PhotonEngine.Instance.role.IsMan)
     {
         playerPrefabName = "Player-boy";
     }
    GameObject playerGo = GameObject.Instantiate(Resources.Load("Player/" + playerPrefabName)) as GameObject;
     playerGo.transform.position = posTransform.position;
     taskDBController = GetComponent<TaskDBController>();
     battleController = GetComponent<BattleController>();
     battleController.OnGetTeam += this.OnGetTeam;
     battleController.OnSyncPositionAndRotation += this.OnSyncPositionAndRotation;
     battleController.OnSyncMoveAnimation += this.OnSyncMoveAnimation;
     battleController.OnSyncPlayerAnimation += this.OnSyncPlayerAnimation;
     battleController.OnGameStateChange += OnGameStateChange;
 }
コード例 #56
0
 public void executeAction(BattleController battle)
 {
     switch(battle.playerAction){   //always remember to list new battle actions (functions below) here.
         case Action.ATTACK :
             attack(battle);
             break;
         case Action.ENRAGED :
             enraged(battle);
             break;
         case Action.HEALOTHER :
             healother(battle);
             break;
         case Action.DOUBLEDAMAGE :
             doubleDamage(battle);
             break;
         case Action.HEAL :
             healself(battle);
             break;
     }
 }
コード例 #57
0
 void Start()
 {
     player = GetComponent<Player>();
     if(GameManger._instance.battleType==BattleType.Team&&PhotonEngine.Instance.role.ID==player.roleID)
     {
         battleController = GameManger._instance.GetComponent<BattleController>();
         isSyncPlayerAnimation = true;
     }
     hp = playerInfo._instance.HP;
     PlayerAttackEffect[] peArray=transform.GetComponentsInChildren<PlayerAttackEffect>();
     foreach(PlayerAttackEffect pe in peArray)
     {
         effectDic.Add(pe.name, pe);
     }
     foreach (PlayerAttackEffect pe in playerEffectArray)
     {
         effectDic.Add(pe.name, pe);
     }
     anim = this.GetComponent<Animator>();
     hpPoint = transform.Find("HpPoint").gameObject;
     hudText = HpBarManager._instance.GetHudText(hpPoint);
     
 }
コード例 #58
0
 protected virtual void Awake()
 {
     bc = GetComponent<BattleController> ();
 }
コード例 #59
0
ファイル: SteveBehavior.cs プロジェクト: jrand35/AmazingRPG
        public override IEnumerator Run(Battler user, Battler target, IList<Battler> allCharacters, IList<Battler> allEnemies, BattleController bc)
        {
            Animator anim = user.GetComponent<Animator>();
            anim.SetInteger("State", 3);
            yield return new WaitForSeconds(1.4f);
            int duration = 40;
            Material m = target.GetComponentInChildren<Renderer>().material;
            m.EnableKeyword("_EMISSION");

            SpecialEffectsManager.RestoreParticles(target);
            for (int i = 0; i < duration; i++)
            {
                m.SetColor("_EmissionColor", Color.white * 0.6f * Mathf.Sin((float) i / duration * Mathf.PI));
                yield return 0;
            }
            target.BattleBehavior.RestoreHP(user, 250);
            anim.SetInteger("State", 0);
            Debug.Log(user.BattleBehavior.Name + " restored 250 HP to " + target.BattleBehavior.Name);
        }
コード例 #60
0
ファイル: TrumpBehavior.cs プロジェクト: jrand35/AmazingRPG
 public override IEnumerator Run(Battler user, Battler target, IList<Battler> allCharacters, IList<Battler> allEnemies, BattleController battlecontroller)
 {
     Animator anim = user.gameObject.GetComponent<Animator>();
     BattleBehavior.Battler.StartCoroutine(SpecialEffectsManager.SpecialName(Name));
     anim.SetInteger("State", 3);
     yield return new WaitForSeconds(2f);
     SpecialEffectsManager.FireParticles(target);
     yield return new WaitForSeconds(1f);
     int baseDamage = (int)(user.BattleBehavior.Stats.SpAttack * Power * 6) - (target.BattleBehavior.Stats.SpDefense * 3);
     if (baseDamage > 0)
         baseDamage = new System.Random().Next((int)(baseDamage * 0.9), (int)(baseDamage * 1.1));
     else
         baseDamage = 0;
     target.BattleBehavior.TakeDamage(user, baseDamage);
     //50% chance of inflicting a burn
     target.BattleBehavior.AddStatusEffect(user, StatusEffect.Burn, 0.5f);
     anim.SetInteger("State", 0);
 }