예제 #1
0
 public Player(Player_Status opera)
 {
     base.enh = new Enhance_Player(opera);
     base.nch = new Choice_Player(opera);
     base.sh  = new Scheme_Player(opera);
     base.sel = new Select_Player(opera);
 }
예제 #2
0
 public void receive(Player_Status player, int ID)
 {
     this.player = player;
     this.ID     = ID;
     GetComponent <Image>().sprite = player.hand[ID].image;
     transform.GetChild(0).GetComponent <Text>().text = "魔力 " + player.hand[ID].pass_force;
 }
예제 #3
0
	// Use this for initialization
	void Start () {
		rbd2D = GetComponent<Rigidbody2D> ();
		anim = GetComponent<Animator> ();
		aL = (Arrow_Launch)FindObjectOfType (typeof(Arrow_Launch));
		directEnemy = (Enemy_Controller)FindObjectOfType (typeof(Enemy_Controller));
		pStatus = (Player_Status)FindObjectOfType (typeof(Player_Status));
	}
예제 #4
0
 public Scheme_Select(List <Scheme> available, Battle next, Player_Status player)
 {
     selection   = new Selection_Scheme_create(this, available);
     this.next   = next;
     battle      = this;
     this.player = player;
 }
예제 #5
0
 public void init(Player_Status player, two_flag finish, int num)
 {
     this.player = player;
     strength    = player.HP;
     this.finish = finish;
     this.num    = num;
 }
예제 #6
0
 public void init(Player_Status player)
 {
     this.player = player;
     GameObject.Find("name").GetComponent <Text>().text       = player.Name;
     GameObject.Find("morale_val").GetComponent <Text>().text = player.Morale.ToString();
     GameObject.Find("base_val").GetComponent <Text>().text   = player.Force_Base.ToString();
 }
예제 #7
0
 public void deletePlayerStatus(Player_Status player_status)
 {
     using (Player_statusRepository player_statusRepository = new Player_statusRepository("DefaultConnection"))
     {
         player_statusRepository.deletePlayerStatus(player_status);
     }
 }
예제 #8
0
        //Finally we pass the player and room information in the player_status. Adding the playerStatus (external call)
        //83: gettting 5 levels for a specific room (room_levels table). The first one is set true.
        // We create a playerStatus for one person when is on a room. Every player_status on every room_level. He is assigned to all all the room_levels (98)
        //The first is starting point true and the rest is created for the player based on the room_levels.
        //Iterating over 5 times and the the room_level index is passed in the objects and the first element (level 1->unlocked) for a player is set to true because of the starting point.
        public void CreatePlayerStatusForARoom(Player player, Room room)
        {
            using (Player_statusRepository player_statusRepository = new Player_statusRepository("DefaultConnection"))
            {
                List <Room_levels> room_levels = Room_LevelsLogic.getRoomLevels(room.ID);

                for (int i = 0; i < room_levels.Count(); i++)

                {
                    Room_levels room_level = room_levels[i];

                    Player_Status player_status = new Player_Status();

                    if (i == 0)
                    {
                        player_status.IsUnlocked = true;
                    }


                    player_status.Player      = player;
                    player_status.Room_levels = room_level;

                    addPlayerStatus(player_status);
                }
            }
        }
예제 #9
0
 // Start is called before the first frame update
 void Start()
 {
     GameController.Instance.currentLevel = currentLevel;
     playerAnimator = this.GetComponent <Animator>();
     playerRb       = this.GetComponent <Rigidbody2D>();
     player_Status  = Player_Status.Active;
 }
예제 #10
0
 public True_Game(Player_Status me)
 {
     finish       = false;
     elapsed      = 0;
     total_damage = 0;
     player       = me;
 }
예제 #11
0
 public Awakening_Sousou(Player_Status me, int add)
 {
     finish    = false;
     elapsed   = 0;
     player    = me;
     add_force = add;
 }
예제 #12
0
 public Enemy(Player_Status opera, Scheme scheme, int level)
 {
     base.enh = new Enhance_Enemy(opera);
     base.nch = new Choice_Enemy(opera, level);
     base.sh  = new Scheme_Enemy(opera, scheme);
     sel      = new Select_Enemy(opera);
 }
예제 #13
0
	// Use this for initialization
	void Start () {
        playerHealth = 100;

        playerStatus = gameObject.GetComponent<Player_Status>();

        OnHealthChanged += HealthChangeListener;
	}
예제 #14
0
    /// <summary>
    /// 経験値取得時のログ
    /// </summary>
    /// <param name="player_status">プレイヤーのステータス</param>
    /// <param name="enemy">倒された敵</param>
    /// <param name="Exp">その敵が倒されたことによって得られる経験値</param>
    public static void Get_Experience_Point(Player_Status player_status, GameObject enemy, int Exp)
    {
        var enemy_status = enemy.GetComponent <Enemy_Status>();

        log.Value += (enemy_status.name + "をたおした。\n");
        log.Value += (player_status.name + "は" + enemy_status.experience_point + "ポイントの経験値をえた。" + "\n");
    }
예제 #15
0
 private void Awake()
 {
     playerStatus        = GetComponent <Player_Status>();
     inputManager        = GetComponent <Player_InputManager>();
     inputManager.OnUlt += CallRiptire;
     playerCamera        = Camera.main;
 }
예제 #16
0
 void Attack()
 {
     //		if (attacking_time > 0)
     //			return;
     player_status = Player_Status.Attack;
     attacking_time  = attack_time_limit;
     AudioPlay("attack");
 }
예제 #17
0
 void Start()
 {
     player             = Player_Manager.Instance.player;
     player_script      = Player_Manager.Instance.player_script;
     player_action      = Player_Manager.Instance.player_action;
     player_status      = Player_Manager.Instance.player_status;
     map_layer          = Dungeon_Manager.Instance.map_layer_2D;
     damage_calculation = new Damage_Calculation();
 }
예제 #18
0
 public create_Scheme_stage(two_flag animation, string name, string disc, Player_Status player)
 {
     Panel     = UnityEngine.Object.Instantiate((GameObject)Resources.Load("scheme/stage/scheme_textpanel"), new Vector2(-1030, -220), Quaternion.identity);
     Character = UnityEngine.Object.Instantiate((GameObject)Resources.Load("scheme/stage/Scheme_player"), new Vector2(-850, 0), Quaternion.identity);
     Panel.GetComponent <scheme_player>().init(animation, "text");
     Panel.GetComponent <scheme_player>().receive_name(name, disc);
     Character.GetComponent <scheme_player>().init(animation, "img");
     Character.GetComponent <scheme_player>().receive_image(player.information);
 }
예제 #19
0
 public Enhance_Scheme(Player_Status player, List <Judge> judge, int add, string disc, string name, int morale)
 {
     this.player = player;
     this.judge  = judge;
     this.add    = add;
     this.mol    = morale;
     this.name   = name;
     this.discr  = disc;
 }
 public Select_Button_create(Vector3 v, Player_Status player)
 {
     this.player = player;
     button[0]   = UnityEngine.Object.Instantiate((GameObject)Resources.Load("Selection/Selection"), v, Quaternion.identity);
     button[1]   = UnityEngine.Object.Instantiate((GameObject)Resources.Load("Selection/Selection"), new Vector3(v.x - 80, v.y - 130), Quaternion.identity);
     button[2]   = UnityEngine.Object.Instantiate((GameObject)Resources.Load("Selection/Selection"), new Vector3(v.x + 80, v.y - 130), Quaternion.identity);
     notif();
     Off();
 }
예제 #21
0
    void Start()
    {
        player        = Player_Manager.Instance.player_script;
        key_observer  = Game.Instance.key_observer;
        enemy_action  = new Enemy_Action();
        player_status = Player_Manager.Instance.player_status;
        map_layer     = Dungeon_Manager.Instance.map_layer_2D;

        player.player_mode = ePlayer_Mode.Nomal_Mode;
    }
예제 #22
0
 void Awake()
 {
     player        = GameObject.Find("Player");
     player_script = player.GetComponent <Player>();
     player_move   = gameObject.AddComponent <Player_Move>();
     player_status = new Player_Status();
     player_status.Initialize();
     player_action = gameObject.AddComponent <Player_Action>();
     action_stair  = gameObject.AddComponent <Action_On_Stair>();
 }
예제 #23
0
 public void Initialize()
 {
     game_manager       = GameManager.Instance;
     enemy_manager      = Enemy_Manager.Instance;
     player             = Player_Manager.Instance.player_script;
     player_status      = Player_Manager.Instance.player_status;
     enemy_status       = new Enemy_Status();
     map_layer          = Dungeon_Manager.Instance.map_layer_2D;
     damage_calculation = Game.Instance.damage_calculation;
 }
예제 #24
0
    void AttackCheck()
    {
        attacking_time -= Time.deltaTime;

        if (attacking_time <= 0) {
        //			attacking_time = 0;
            player_status = Player_Status.Moving;
            attack_CDtime = attack_CDtime_limit;
        }
    }
예제 #25
0
 //Adding a player_status if it is not already in the table.
 //player_status room_levels (id of it)
 //Finding a player_status by searching the player and player's room_levels. If the player is not already in the table, we add it.
 public void addPlayerStatus(Player_Status player_status)
 {
     using (Player_statusRepository player_statusRepository = new Player_statusRepository("DefaultConnection"))
     {
         if (findPlayerStatus(player_status.Player, player_status.Room_levels) == null)
         {
             player_statusRepository.addPlayerStatus(player_status);
         }
     }
 }
예제 #26
0
    /// <summary>
    /// 現在の状態に合った行動をする 毎ループ呼び出す ここでゲームオーバー判定を行う
    /// </summary>
    public void Run_Action()
    {
        // プレイヤーのステータス関係のクラス 死亡判定に使用
        Player_Status player_status = Player_Manager.Instance.player_status;

        Debug.Log(player.player_state);
        Debug.Log(player.player_mode);
        Debug.Log(player.direction);
        Debug.Log("player_feet = " + player.Feet);

        switch (player.player_state)
        {
        case ePlayer_State.Move:
            player_move.Action_Move();
            break;

        case ePlayer_State.Attack:
            player_attack.Action_Attack();
            break;

        case ePlayer_State.On_Stair:
            action_stair.Action_Stair();
            break;

        case ePlayer_State.Decide_Command:
            var decide_dungeon = new Decide_Dungeon();
            decide_dungeon.In_Decide();
            break;

        case ePlayer_State.Battle_Menu:
            Action_Battle_Menu();
            break;

        case ePlayer_State.Game_Over:
            SceneManager.LoadScene("Result");
            Enemy_Manager.Instance.enemies.Clear();
            break;
        }

        if (player.Feet == Define_Value.ENTRANCE_LAYER_NUMBER)
        {
            player_status.Where_Floor((int)player.position.x, (int)player.position.y);
        }

        // プレイヤーが生きていたら死亡判定をする
        if (player.Exist == true)
        {
            // 体力が 0 以下ならゲームオーバー処理に切り替える
            if (player.player_state != ePlayer_State.Game_Over && player_status.Is_Dead(player_status.hit_point.Value))
            {
                Set_Action(ePlayer_State.Game_Over);
            }
        }
    }
예제 #27
0
 private void OnWilt()
 {
     if (GhostPath.Count < 1)
     {
         GhostPath.Add(Vector3.zero);
         GhostRotation.Add(Vector3.zero);
         InteractionState.Add(false);
     }
     status = Player_Status.wilting;
     AC.SetTrigger("OnWilt");
 }
예제 #28
0
    /**
     * defines collison of bullet
     * @pre bullet must be fired
     * @post if it collides with enemy,damage is dealt
     * @param collison is a Collider2D object
     * @return void
     **/
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Player_Status player = collision.GetComponent <Player_Status>();

        if (player != null)
        {
            Debug.Log("TEST 10: ENEMY SHOT PLAYER PASSED");
            player.TakeDmg(damage);
        }
        Destroy(gameObject);
    }
예제 #29
0
 public void Kill()
 {
     if (isInteracting)
     {
         onInteractEnd?.Invoke();
     }
     isActive      = false;
     isInteracting = false;
     status        = Player_Status.dead;
     AC.SetTrigger("OnWilt");
 }
예제 #30
0
 public void Animate()
 {
     isActive      = true;
     isInteracting = false;
     //gameObject.SetActive(true);
     maxIndex      = (int)(duration * (1 / Time.fixedDeltaTime));
     finalAction   = GhostPath[GhostPath.Count - 1];
     finalAction.y = 0; // Prevent ghost from jumping up forever
     //finalRotation = GhostRotation[GhostRotation.Count - 1];
     status = Player_Status.spawning;
     AC.SetTrigger("OnSpawn");
 }
 public Change_fatgue_injury_Scheme(Player_Status me, List <Judge> judge, string name, string disc, int morale, int force, int add_fatigue, int add_injury)
 {
     /*me変数は、必殺技の対象となるキャラクタ*/
     hand           = judge;
     this.add_force = force;
     this.name      = name;
     this.disc      = disc;
     this.mol       = morale;
     this.hand      = judge;
     this.fatigue   = add_fatigue;
     this.injury    = add_injury;
     player         = me;
 }
예제 #32
0
 public void init(Player_Status player, Hero hero)
 {
     force = player.Force_Base;
     Name  = player.Name;
     disc  = player.disc;
     player.init();
     GetComponent <Image>().sprite = player.image;
     GameObject.Find("option_character").GetComponent <Image>().sprite = GetComponent <Image>().sprite;
     GameObject.Find("status").GetComponent <Text>().text      = force.ToString();
     GameObject.Find("name").GetComponent <Text>().text        = Name;
     GameObject.Find("discription").GetComponent <Text>().text = disc;
     this.hero = hero;
 }
예제 #33
0
 private void OnSpawn()
 {
     Debug.Log("PS::Player spawned at " + spawnCoord);
     AC.SetBool("isMoving", false);
     PC.FreezePlayer();
     transform.position = spawnCoord;
     transform.rotation = Quaternion.Euler(spawnRot);
     ResetGhosts();
     AnimateGhosts();
     AC.SetTrigger("OnSpawn");
     status = Player_Status.spawning;
     sproutingEvent.Post(gameObject);
 }
예제 #34
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     //吃宝石加分数
     if (other.gameObject.tag == "Gem")
     {
         GameController.Instance.score += 10;
         Destroy(other.gameObject);
     }
     //吃宝箱道具
     if (other.gameObject.tag == "Box")
     {
         other.gameObject.GetComponent <Animator>().SetTrigger("Open");
         it = Instantiate(item, other.transform.position, other.transform.rotation);
         Destroy(other.gameObject, 0.5f);
     }
     //吃道具,获得攻击技能
     if (other.gameObject.tag == "Item")
     {
         this.canAttack = true;
         Debug.Log(canAttack);
         Destroy(it, 1f);
     }
     if (other.gameObject.tag == "StairCase")
     {
         canClimb = true;
         Debug.Log("canClimb:" + canClimb);
         playerRb.gravityScale = 0;
     }
     if (other.gameObject.tag == "Enemy")
     {
         if (GameController.Instance.playerHealth >= 0 && this.player_Status == Player_Status.Active)
         {
             StartCoroutine(Die());
         }
         else if (GameController.Instance.playerHealth < 0 && this.player_Status == Player_Status.Die)
         {
             StopCoroutine(Die());
             GameController.Instance.game_Status = Game_Status.GameOver;
             GameController.Instance.LoadScene("GameOver");
         }
         player_Status = Player_Status.Die;
     }
     if (other.gameObject.tag == "Transporter")
     {
         LevelManager.Instance.currentlevel++;
         GameController.Instance.LoadScene("SelectLevel");
     }
 }
예제 #35
0
 void GlidingHandle()
 {
     GetComponent<Rigidbody2D>().velocity = Vector2.zero;
     GetComponent<Rigidbody2D>().AddForce (transform.up*glidingForce);
     player_status = Player_Status.Gliding_Jump;
     AudioPlay("glide2");
 }
예제 #36
0
    void OnCollisionEnter2D(Collision2D coll)
    {
        if(player_status == Player_Status.Jump
           || player_status == Player_Status.Jump2
           || player_status == Player_Status.Gliding
           ){
            if (coll.gameObject.tag == "Floor") {
                player_status = Player_Status.Moving;
        //				anim.SetBool("Sheep_fail", false);
            }
        }

        if (coll.gameObject.tag == "Needle") {
            player_status = Player_Status.Dead;
        }

        if (coll.gameObject.tag == "Enemy" && player_status != Player_Status.Attack) {
            player_status = Player_Status.Dead;
        }

        if (coll.gameObject.tag == "Goal") {
            player_status = Player_Status.Pass;
        }
    }
예제 #37
0
    void Jump()
    {
        if (player_status == Player_Status.Jump) {
            GetComponent<Rigidbody2D>().velocity = Vector2.zero;
            player_status = Player_Status.Jump2;
            AudioPlay("jump2");
        }
        else{
            player_status = Player_Status.Jump;
            AudioPlay("jump1");
        }

        GetComponent<Rigidbody2D>().AddForce (transform.up*jumpForce);
    }
 // Use this for initialization
 void Start()
 {
     status = GetComponent<Player_Status>();
     actualState = status.getState();
 }
예제 #39
0
    // Use this for initialization
    void Start()
    {
        currentState = State.preStart;

        GameObject player = GameObject.FindGameObjectWithTag("Player");
        playerMotor = player.GetComponent<CharacterMotor>();
        playerStatus = player.GetComponent<Player_Status>();

        inkubatorEnemyControllers = GameObject.FindObjectsOfType<InkubatorEnemy_TransparencyController>();
    }
예제 #40
0
    void Start()
    {
        player_status = Player_Status.Moving;
        player_name = gameObject.name;
        anim = gameObject.GetComponent<Animator>();

        Physics2D.gravity = new Vector3(0, -9.8f, 0);
    }
예제 #41
0
 void Glide()
 {
     GetComponent<Rigidbody2D>().AddForce (transform.up*glideJumpForce);
     player_status = Player_Status.Gliding;
     AudioPlay("glide1");
 }
예제 #42
0
 void Awake()
 {
     player_status = Player_Status.Moving;
 }
예제 #43
0
 void GlidingJumpCheck()
 {
     if (GetComponent<Rigidbody2D>().velocity.y < 0)
         player_status = Player_Status.Gliding;
 }
예제 #44
0
    void FixedUpdate()
    {
        switch (player_name) {
        case "Hero1":
            break;
        case "Hero2":
            break;
        case "Hero3":
            if(attack_CDtime > 0)
                attack_CDtime -= Time.deltaTime;
            break;
        case "Hero4":
            break;
        case "Hero5":
            break;
        default:
            break;
        }

        switch(player_status){
        case Player_Status.Dead:
        //gooku			Application.LoadLevel(Application.loadedLevel);
            GameManger.game_status = GameManger.Game_Status.Over;
            AudioPlay("fail");
            player_status = Player_Status.Over;
            Destroy(GetComponent<Rigidbody2D>());
            break;
        case Player_Status.Over:
            break;
        case Player_Status.Pass:
            Physics2D.gravity = new Vector3(0, -9.8f, 0);
            GameManger.game_status = GameManger.Game_Status.Pass;
            break;
        case Player_Status.Attack:
        //gooku			PlayerFunction ();
            Movement ();
            break;
        default:
        //gooku			PlayerFunction ();
            Movement ();
            break;
        }
    }