Esempio n. 1
0
	// todo please please please change this
	private static void FigureTypeBalances(ref PokemonInfo info ,pokemonType type)
	{
		switch (type) {
		case pokemonType.fire:
			info.weak.Add (pokemonType.water);
			info.weak.Add (pokemonType.rock);
			info.resistant.Add (pokemonType.grass);
			info.resistant.Add (pokemonType.ghost);
			break;

		case pokemonType.water:
			info.weak.Add (pokemonType.grass);
			info.weak.Add (pokemonType.electric);
			info.resistant.Add (pokemonType.fire);
			info.resistant.Add (pokemonType.water);
			info.resistant.Add (pokemonType.rock);
			break;

		case pokemonType.grass:
			info.weak.Add (pokemonType.fire);
			info.weak.Add (pokemonType.normal);
			info.resistant.Add (pokemonType.water);
			info.resistant.Add (pokemonType.grass);
			info.resistant.Add (pokemonType.electric);
			break;

		case pokemonType.ghost:
			info.weak.Add (pokemonType.fire);
			info.weak.Add (pokemonType.ghost); // todo i dont want types countering itself
			info.weak.Add (pokemonType.electric);
			info.weak.Add (pokemonType.psychic);
			info.immune.Add (pokemonType.normal);
			info.immune.Add (pokemonType.fighting);
			break;

		case pokemonType.normal:
			info.weak.Add (pokemonType.normal); // todo, again dont want types countering itself
			break;

		case pokemonType.electric:
			info.weak.Add (pokemonType.fighting);
			break;

		case pokemonType.psychic:
			info.weak.Add (pokemonType.ghost);
			info.weak.Add (pokemonType.rock);
			info.resistant.Add (pokemonType.psychic);
			break;

		case pokemonType.fighting:
			info.weak.Add (pokemonType.psychic);
			info.resistant.Add (pokemonType.rock);
			break;

		default:
			break;
		}
	}
Esempio n. 2
0
	public AttackInfo(int teamId, pokemonType type, float dmg, PokemonInfo pokemon, PlayerInfo player, System.Action<HitInfo> hitcallback, System.Action<HitInfo> killcallback)
	{
		this.teamId = teamId;
		this.type = type;
		this.damage = dmg;
		this.pokemon = pokemon;
		this.player = player;
		this.hitCallback = hitcallback;
		this.killCallback = killcallback;
	}
	void setCharacter(pokemonType type)
	{
		SoundPlayer.soundPlayer.playSound ("MenuClick");

		// character was picked, need to add it to array and set its image
		if (selectedSixTypes.Count < selectedMax && !selectedSixTypes.Contains(type)) {
			selectedSixTypes.Add (type);
			moveImage (type, true);

			// last slot was filled
			if (selectedSixTypes.Count == selectedMax) {
				readyMenu.gameObject.SetActive (true);
			}
			moveInfoToSelected (type);
		}

		setInfo (type);

	}
Esempio n. 4
0
	public static PokemonInfo create(string _name, pokemonType _type, string portraitName = default(string), string animatorName =  default(string))
	{
		PokemonInfo info = new PokemonInfo();
		// set basic vars
		info.name = _name;
		info.type = _type;
		info.level = 0;

		// set portraits
		if (portraitName == default(string)) {
			portraitName = info.name.ToLower ().Substring (0, 4) + "_port";
		}
		if (animatorName == default(string)) {
			animatorName = info.name.ToLower ().Substring (0, 4) + "_anim";
		}

		info.portrait = (Texture)Resources.Load ("pokemon/" + info.name + "/" + portraitName);
		info.animator = Resources.Load ("pokemon/" + info.name + "/" + animatorName) as RuntimeAnimatorController;

		// set type balances
		info.weak = new List<pokemonType>();
		info.resistant = new List<pokemonType> ();
		info.immune = new List<pokemonType> ();
		FigureTypeBalances(ref info, info.type);

		// get attack animators
		loadAttackAnimators (ref info, info.type);


		// get icons
		info.typeIcon = (Texture)Resources.Load("images/icons/bigCircle/"+_type.ToString().ToLower());
		info.weakIcons = new List<Texture> ();
		info.resistantIcons = new List<Texture> ();
		for (int i = 0; i < info.weak.Count; i++) {
			info.weakIcons.Add ((Texture)Resources.Load ("images/icons/bigCircle/" + info.weak [i].ToString ().ToLower ()));
		}
		for (int i = 0; i < info.resistant.Count; i++) {
			info.resistantIcons.Add ((Texture)Resources.Load ("images/icons/bigCircle/" + info.resistant [i].ToString ().ToLower ()));
		}

		return info;
	}
	void moveImage(pokemonType type, bool toSelected, int index = -1)
	{
		if (index == -1)
			index = currentSelectedIndex;
		
		InstantGuiButton typeBtn = null;

		switch (type) {
		case pokemonType.electric:
			typeBtn = electricBtn;
			break;
		case pokemonType.psychic:
			typeBtn = psychicBtn;
			break;
		case pokemonType.fire:
			typeBtn = fireBtn;
			break;
		case pokemonType.ghost:
			typeBtn = ghostBtn;
			break;
		case pokemonType.fighting:
			typeBtn = fightingBtn;
			break;
		case pokemonType.rock:
			typeBtn = rockBtn;
			break;
		case pokemonType.grass:
			typeBtn = grassBtn;
			break;
		case pokemonType.water:
			typeBtn = waterBtn;
			break;
		case pokemonType.normal:
			typeBtn = normalBtn;
			break;
		default:
			break;
		}
		if (typeBtn != null) {
			swapTextures (ref selectedBtns [index], ref typeBtn);
		}

		if (toSelected) {
			selectedSixBtns.Add (typeBtn);
			currentSelectedIndex++;
		}
		else
			currentSelectedIndex--;
	}
	public void moveInfoToSelected(pokemonType type)
	{
		//set info
		characterInfoList.ForEach (delegate (PokemonInfo obj) {
			if (obj.type == type) {
				selectedCharacterInfoList.Add(obj);
			}
		});
	}
	void setInfo (pokemonType type)
	{
		return;
		//set info
		characterInfoList.ForEach (delegate (PokemonInfo obj) {
			if (obj.type == type) {
				pokemonNameLbl.text = obj.name;
				pokemonTypeLbl.text = obj.type.ToString();
				if (obj.weakIcons.Count >= 1) 
					pokemonWeak1.style.main.texture = obj.weakIcons[0];
				if (obj.weakIcons.Count > 1) 
					pokemonWeak2.style.main.texture = obj.weakIcons[1];
				if (obj.resistantIcons.Count >= 1) 
					pokemonResistant1.style.main.texture = obj.resistantIcons[0];
				if (obj.resistantIcons.Count > 1) 
					pokemonResistant2.style.main.texture = obj.resistantIcons[1];

			}
		});
	}
	void getTypeIcon(pokemonType type)
	{

	}
Esempio n. 9
0
	private static void loadAttackAnimators(ref PokemonInfo info, pokemonType type)
	{
		switch (type) {
		case pokemonType.fire:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/FireBlast") as RuntimeAnimatorController;
			break;

		case pokemonType.water:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Water") as RuntimeAnimatorController;
			break;

		case pokemonType.grass:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Grass") as RuntimeAnimatorController;
			break;

		case pokemonType.ghost:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Ghost") as RuntimeAnimatorController;
			break;

		case pokemonType.normal:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Normal") as RuntimeAnimatorController;
			break;

		case pokemonType.electric:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Electric") as RuntimeAnimatorController;
			break;

		case pokemonType.psychic:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Psychic") as RuntimeAnimatorController;

			break;

		case pokemonType.fighting:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Fighting") as RuntimeAnimatorController;
			break;
		case pokemonType.rock:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Rock") as RuntimeAnimatorController;
			break;

		default:
			info.attackAnimator = Resources.Load ("attacks/AttackAnimation/Fighting") as RuntimeAnimatorController;
			break;
		}
	}
Esempio n. 10
0
	void playHitSound(pokemonType type)
	{
		SoundPlayer.soundPlayer.playSound ("genericHurt", transform.position);
	}