How would i add this with my code

Alright s as i have said pokemon blah blah duel types how would i add this this is the way i have it now lets say this is you’re first pokemon

Player = {
"atk": 15,
"def": 18,
"exp": 50,
"faint": false,
"hp": 16,
"index": 1,
"level": 7,
"max_exp": 210,
"max_hp": 17,
"name": "mudkip",
"spd": 19,
"type": "Water"
}

cool so they have a type now type advantages how do we do that?

var type_effectiveness = getMultiplier(mov.type,OStats.type)

mov.type being the moves type and OStats.type being the Enemys type

func getMultiplier(Move_type,Entity_type):
	if Move_type in Type.typx and Entity_type in Type.typx[Move_type]:
		return Type.typx[Move_type][Entity_type]
	else:
		return 1
extends Control
class_name types
var typx = {
	"Normal": {"Normal": 1, "Fire": 1, "Water": 1, "Rock": .5, "Steel": .5, "Ghost": 0, "Electric": 1, "Grass": 1, "Ice": 1, "Fighting": 1, "Poison": 1, "Ground": 1, "Flying": 1, "Psychic": 1,"Bug": 1,"Dragon": 1,"Dark": 1,"Fairy": 1},
	"Fire": {"Normal": 1, "Fire": .5, "Water": .5, "Rock": .5, "Steel": 2, "Ghost": 1, "Electric": 1, "Grass": 2, "Ice": 2, "Fighting": 1, "Poison": 1, "Ground": 1, "Flying": 1, "Psychic": 1,"Bug": 2,"Dragon": .5,"Dark": 1,"Fairy": 1},
	"Water": {"Normal": 1, "Fire": 2, "Water": .5, "Rock": 2, "Steel": 1, "Ghost": 1, "Electric": 1, "Grass": .5, "Ice": 1, "Fighting": 1, "Poison": 1, "Ground": 2, "Flying": 1, "Psychic": 1,"Bug": 1,"Dragon": .5,"Dark": 1,"Fairy": 1},
	"Grass": {"Normal": 1, "Fire": .5, "Water": 2, "Rock": 2, "Steel": .5, "Ghost": 1, "Electric": 1, "Grass": .5, "Ice": 1, "Fighting": 1, "Poison": .5, "Ground": 2, "Flying": .5, "Psychic": 1,"Bug": .5,"Dragon": .5,"Dark": 1,"Fairy": 1}
}

now with all this code how would i add duel types?

nvm i got it

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.