Inheritance: MonoBehaviour
 public void SelectPartyMember(int index)
 {
     ResetSelection();
     if (Parties[currentParty].Count >= index + 1)
     {
         if (currentMember == Parties[currentParty][index])
         {
             currentMember = null;
             return;
         }
         else
         {
             currentMember            = Parties[currentParty][index];
             currentMember.isSelected = true;
             currentMember.sprite.GetComponent <SpriteOutline>().enabled = currentMember.isSelected;
             if (currentMember.CombChar.castTarget != null)
             {
                 currentMember.CombChar.castTarget.sprite.GetComponent <SpriteOutline>().enabled = true;
             }
         }
     }
     if (currentMember != null)
     {
         currentMember.Menu.sortingOrder = 50;
         StartCoroutine(rollCam());
     }
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        ControleGame.vida = health;
        //Setup our camera reference
        if (Camera.main != null)
        {
            cam = Camera.main.transform;
        }

        //and our Character Movement
        character = GetComponent <CharMove> ();
        //and our animator
        anim = GetComponent <Animator>();
        //and our weapon manager
        weaponManager = GetComponent <WeaponManager>();
        //and the collider


        //And setup the reference to the FreeCameraLook,
        //but since we already have store the camera,
        //we can navigate to the root transform to get the component from there instead of searching for it
        cameraFunctions = Camera.main.transform.root.GetComponent <FreeCameraLook>();

        //Store the offset of the crosshair
        //offsetCross = cameraFunctions.crosshairOffsetWiggle;
    }
Example #3
0
 void Start()
 {
     charController = player.GetComponent <CharacterController>();
     playerScript   = player.GetComponent <CharMove>();
     Debug.Log("howdy");
     //charController.enabled = false;
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     coins  = 0;
     Energy = 100f;
     cm     = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
     bl     = GameObject.Find("backlight").GetComponent <BackLight>();
     pb     = GameObject.Find("PauseButton").GetComponent <PauseButton>();
 }
 // Start is called before the first frame update
 void Start()
 {
     //pre write vectors of (0,1,0), (0,-1,0),(1,0,0),(-1,0,0) all orthognal to directional vector
     dirs         = new[] { transform.up, -transform.up, transform.right, -transform.right };
     playerScript = player.GetComponent <CharMove>();
     startPos     = transform.localPosition;
     //masterPlayer = Find("/player");
 }
Example #6
0
    void Start()
    {
        if (Camera.main != null)
        {
            cam = Camera.main.transform;
        }

        character = GetComponent<CharMove>();
    }
Example #7
0
	// Use this for initialization
	void Start () 
	{
		moveScript = GameObject.Find("GJ1_CharacterWalk_L").GetComponent<CharMove>();
		directionL = moveScript.leftFace;
		directionR = moveScript.rightFace;
		directionU = moveScript.backFace;
		directionD = moveScript.frontFace;
		Destroy (this.gameObject,lifeTime);
	}
Example #8
0
    // Use this for initialization
    void Start()
    {
        cdp      = GameObject.FindGameObjectWithTag("stationpoint").GetComponent <CalDistancePlayer>();
        cd       = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharacterData>();
        cm       = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
        cuolt    = GameObject.FindGameObjectWithTag("CoinUIsOnLeftTop").GetComponent <CoinUIOnLeftTop>();
        position = GameObject.FindGameObjectWithTag("legpoint");

        v = this.transform.position;
    }
Example #9
0
    void Start()
    {
        if (Camera.main != null)
        {
            cam = Camera.main.transform;
        }

        character = GetComponent <CharMove>();
        anim      = GetComponent <Animator>();
    }
Example #10
0
	void Start ()
	{

		/*cameraContainer = GameObject.Find ("Camera");
		
		if (Camera.main != null) {
			cam = Camera.main.transform;
		}*/

		character = GetComponent<CharMove> ();
	}
Example #11
0
 // Use this for initialization
 void Start()
 {
     cuolt = GameObject.FindGameObjectWithTag("CoinUIsOnLeftTop").GetComponent <CoinUIOnLeftTop>();
     cd    = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharacterData>();
     cm    = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
     hl    = GameObject.FindGameObjectWithTag("effect").GetComponent <Heallight>();
     sccu  = GameObject.Find("SavingCoinCounter").GetComponent <SavingCoinCounterUI>();
     wc    = GameObject.Find("GameSaveWindow").GetComponent <WindowCol>();
     cl    = GameObject.Find("ColForStation").GetComponent <ColforLand>();
     sb    = GameObject.Find("SaveButton").GetComponent <SaveButton>();
 }
Example #12
0
    void Start()
    {
        charController  = player.GetComponent <CharacterController>();
        playerScript    = player.GetComponent <CharMove>();
        offsetSpawnNext = next.GetComponent <teleport>().offsetSpawn;

        layerThemeForMirror = GetComponent <AudioSource>();
        //monstTrick = player.transform.GetChild(1).GetComponent<MonsterTrickle>();
        //Debug.Log("howdy");
        //charController.enabled = false;
    }
Example #13
0
    private void Start()
    {
        jumpStart  = JumpCount;
        controller = GetComponent <CharacterController>();

        GameObject Player = GameObject.FindGameObjectWithTag("Player");

        CM = Player.GetComponent <CharMove>();

        anim       = GetComponent <Animator>();
        jumping    = false;
        jumpCheckr = false;
    }
Example #14
0
 public void UpdateMoveSelection(int selectedMove, CharMove move)
 {
     for (int i = 0; i < moveTexts.Count; ++i)
     {
         if (i == selectedMove)
         {
             moveTexts[i].color = highlightedColor;
         }
         else
         {
             moveTexts[i].color = Color.black;
         }
     }
     movedetailsText.text = move.Base.Description;
     movecostText.text    = $"{move.Base.MoveCost}/{move.MOVECOST}";
 }
Example #15
0
    public bool TakeDamage(CharMove move, Char attacker)
    {
        float modifiers = Random.Range(0.85f, 1f);
        float a         = (2 * attacker.Level + 10) / 250f;
        float d         = a * move.Base.Attackpower * ((float)attacker.Attack / Defence) + 2;
        int   damage    = Mathf.FloorToInt(d * modifiers);

        CurrentHP -= damage;
        if (CurrentHP <= 0)
        {
            CurrentHP = 0;
            return(true);
        }

        return(false);
    }
Example #16
0
	void Start () {
		agent = GetComponentInChildren<NavMeshAgent> ();
		charMove = GetComponent<CharMove> ();
		anim = GetComponent<Animator> ();
		weaponManager = GetComponent<WeaponManager> ();

		//Retreives waypoints' transforms from a game object containing them
		if (waypointHolder) {
			Transform[] wayp = waypointHolder.GetComponentsInChildren<Transform> ();

			foreach (Transform tr in wayp) {
				if (tr != waypointHolder.transform) {
					waypoints.Add (tr);
				}
			}
		} 
	}
Example #17
0
    public void ManageMove(CharMove following)
    {
        int index = int.Parse(partyNumberText.text);

        index = index - int.Parse(following.partyNumberText.text);
        index = index > 0 ? index : index * -1;
        Floor floor = pathfinder.ground.GetTile(Vector3Int.FloorToInt(transform.position)) as Floor;

        if (following.wayPoints.Count > index)
        {
            transform.position = Vector2.MoveTowards(
                transform.position,
                following.wayPoints[index],
                Char.speed * Time.deltaTime * floor.moveMultiplier
                );
        }
    }
Example #18
0
    void Start()
    {
        heallight = GameObject.FindGameObjectWithTag("effect").GetComponent <Renderer>();
        gep       = GameObject.FindGameObjectWithTag("station").GetComponent <GiveEnergy2Player>();
        cdp       = GameObject.FindGameObjectWithTag("stationpoint").GetComponent <CalDistancePlayer>();
        cd        = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharacterData>();
        cm        = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
        sccu      = GameObject.Find("SavingCoinCounter").GetComponent <SavingCoinCounterUI>();
        wc        = GameObject.Find("GameSaveWindow").GetComponent <WindowCol>();
        cl        = GameObject.Find("ColForStation").GetComponent <ColforLand>();
        sb        = GameObject.Find("SaveButton").GetComponent <SaveButton>();
        sctu      = GameObject.Find("CoinShooter").GetComponent <SootingCoinsToUI>();
        asct      = GameObject.Find("AddOrSubCoinsText");
        A         = GameObject.FindGameObjectWithTag("legpoint");

        v      = this.transform.position;
        callwa = true;
    }
Example #19
0
    protected override void OnUpdate(float deltaTime)
    {
        base.OnUpdate(deltaTime);

        if (UIJoystick.Joystick != null)
        {
            if (CharSkill.IsAnyLife())
            {
                return;
            }
            if (UIJoystick.Joystick.IsDragging)
            {
                Vector2 joyAxis = UIJoystick.Joystick.JoystickAxis;
                Vector3 joyDir  = Camera.main.transform.forward * joyAxis.y + Camera.main.transform.right * joyAxis.x;
                CharMove.BeginJoyMove(joyDir);
            }
        }
    }
Example #20
0
	void Start ()
	{
		if (Camera.main != null) {
			cam = Camera.main.transform;
		}

		character = GetComponent<CharMove> ();

		anim = GetComponent<Animator> ();



		weaponManager = GetComponent<WeaponManager> ();

		col = GetComponent<CapsuleCollider> ();
		startHeight = col.height;

		cameraFunctions = Camera.main.GetComponentInParent<FreeCameraLook> ();

		offsetCross = cameraFunctions.crosshairOffsetWiggle;
	}
    // Start is called before the first frame update
    void Start()
    {
        //pre write vectors of (0,1,0), (0,-1,0),(1,0,0),(-1,0,0) all orthognal to directional vector
        dirs = new[] { transform.up, -transform.up, transform.right, -transform.right };

        //external voice clip of the monster, multiple can be added
        monsterVoice.clip = voices[0];

        //gets the monsters current position and saves it as a start point, the monster will reset to this
        startPos = transform.localPosition;


        masterPlayer = GameObject.FindGameObjectWithTag("Player");

        //may need to remove this variable due to redundancy of masterPlayerScript but it still works so to avoid unneccasry work this variable will stay
        playerScript         = player.GetComponent <CharMove>();
        masterPlayerScript   = masterPlayer.GetComponent <CharMove>();
        masterCharController = masterPlayer.GetComponent <CharacterController>();

        //for spawning on a mirror when captured to avoid the being teleported. tthe player will spawn a distance away from the teleporter instead of disabling the teleporter
        offsetSpawn = masterPlayerScript.lastMirror.GetComponent <teleport>().offsetSpawn;
    }
Example #22
0
    // Use this for initialization
    void Start()
    {
        cointrans          = GameObject.FindGameObjectWithTag("coinuionlefttop").GetComponent <Transform>();
        coinrender         = GameObject.FindGameObjectWithTag("coinuionlefttop").GetComponent <Renderer>();
        numberrender       = GameObject.FindGameObjectWithTag("cointextuionlefttop").GetComponent <MeshRenderer>();
        addsubnumberrender = GameObject.Find("AddOrSubCoinsText").GetComponent <MeshRenderer>();
        gep  = GameObject.FindGameObjectWithTag("station").GetComponent <GiveEnergy2Player>();
        cdp  = GameObject.FindGameObjectWithTag("stationpoint").GetComponent <CalDistancePlayer>();
        cd   = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharacterData>();
        cm   = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
        sb   = GameObject.Find("SaveButton").GetComponent <SaveButton>();
        asct = GameObject.Find("AddOrSubCoinsText").GetComponent <AddSubCoinsText>();
        pc   = GameObject.FindGameObjectWithTag("Cha1").GetComponent <PauseCtrl>();
        cl   = GameObject.Find("ColForStation").GetComponent <ColforLand>();
        A    = GameObject.FindGameObjectWithTag("legpoint");
        ewb  = GameObject.Find("ExitWButton").GetComponent <ExitWButton>();
        v    = this.transform.position;

        coinrender.material.color         = new Vector4(coinrender.material.color.r, coinrender.material.color.g, coinrender.material.color.b, 0f);
        numberrender.material.color       = new Vector4(numberrender.material.color.r, numberrender.material.color.g, numberrender.material.color.b, 0f);
        addsubnumberrender.material.color = new Vector4(addsubnumberrender.material.color.r, addsubnumberrender.material.color.g, addsubnumberrender.material.color.b, 0f);

        totalcoins = 0;
    }
 public int GetPartyIndex(CharMove Char)
 {
     return(Parties[currentParty].IndexOf(Char));
 }
Example #24
0
    // Use this for initialization
    void Start()
    {
        Player = FindObjectOfType <CharMove>();

        isFollowing = true;
    }
 // Start is called before the first frame update
 void Start()
 {
     targetScript = target.GetComponent <CharMove>();
 }
Example #26
0
 // Use this for initialization
 void Start()
 {
     cm = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
     pb = GameObject.Find("PauseButton").GetComponent <PauseButton>();
 }
Example #27
0
 // Use this for initialization
 void Start()
 {
     cm   = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
     asct = GameObject.Find("AddOrSubCoinsText");
     hl   = GameObject.FindGameObjectWithTag("effect").GetComponent <Heallight>();
 }
Example #28
0
 // Use this for initialization
 void Start()
 {
     cm = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
     cd = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharacterData>();
 }
Example #29
0
 // Start is called before the first frame update
 void Start()
 {
     playerScript = target.GetComponent <CharMove>();
     charCont     = target.GetComponent <CharacterController>();
     offsetSpawn  = playerScript.lastMirror.GetComponent <teleport>().offsetSpawn;
 }