-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharCreator.gd
126 lines (102 loc) · 3.29 KB
/
CharCreator.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
extends Control
var userClass = "war"
var userAbl1 = "rage"
var userAbl2 = "toughness"
var userSkllPnts = 30
var userStr = 10
var userDex = 10
var userInt = 10
var userChr = 10
@onready var abl1 = get_node("MarginContainer/VBoxContainer/HBoxContainer6/Abl1")
@onready var abl2 = get_node("MarginContainer/VBoxContainer/HBoxContainer6/Abl2")
@onready var skllPntsLbl = get_node("MarginContainer/VBoxContainer/HBoxContainer7/SkllPntsLbl")
@onready var strLbl = get_node("MarginContainer/VBoxContainer/HBoxContainer2/StrLbl")
@onready var dexLbl = get_node("MarginContainer/VBoxContainer/HBoxContainer3/DexLbl")
@onready var intLbl = get_node("MarginContainer/VBoxContainer/HBoxContainer4/IntLbl")
@onready var chrLbl = get_node("MarginContainer/VBoxContainer/HBoxContainer5/ChrLbl")
func _on_war_btn_pressed():
userClass = "war"
userAbl1 = "rage"
abl1.text = str("Rage")
abl1.tooltip_text = str("Active/Continuous: As long as you recieve or give damage in every turn, get +(str/5) damage in your melee attacks")
userAbl2 = "toughness"
abl2.text = str("Toughness")
abl2.tooltip_text = str("Passive: Melee attacks against you gets -2 in damage")
func _on_ran_btn_pressed():
userClass = "ran"
userAbl1 = "pArrow"
abl1.text = str("Piercing Arrow")
abl1.tooltip_text = str("Active: Use a special arrow that does +(dex/5) to an enemy you can use this skill (dex/5) times in combat")
userAbl2 = "dodge"
abl2.text = str("Dodge")
abl2.tooltip_text = str("Passive: Ranged attacks against you gets -2 in accuracy")
func _on_mag_btn_pressed():
userClass = "mag"
userAbl1 = "fBall"
abl1.text = str("Fireball")
abl1.tooltip_text = str("Active: Throw an fireball that hits multiple enemies with (int/-5) accuracy (penalty can not pass 0)")
userAbl2 = "mArmour"
abl2.text = str("Magic Armour")
abl2.tooltip_text = str("Passive: Magic attacks against you gets -2 in damage")
func _on_str_minu_pressed():
if userStr > 10:
userStr -= 1
userSkllPnts += 1
updateStr()
func _on_str_plus_pressed():
if userSkllPnts > 0:
userStr += 1
userSkllPnts -= 1
updateStr()
func updateStr():
strLbl.text = str(userStr)
skllPntsLbl.text = str(userSkllPnts)
func _on_dex_minu_pressed():
if userDex > 10:
userDex -= 1
userSkllPnts += 1
updateDex()
func _on_dex_plus_pressed():
if userSkllPnts > 0:
userDex += 1
userSkllPnts -= 1
updateDex()
func updateDex():
dexLbl.text = str(userDex)
skllPntsLbl.text = str(userSkllPnts)
func _on_int_minu_pressed():
if userInt > 10:
userInt -= 1
userSkllPnts += 1
updateInt()
func _on_int_plus_pressed():
if userSkllPnts > 0:
userInt += 1
userSkllPnts -= 1
updateInt()
func updateInt():
intLbl.text = str(userInt)
skllPntsLbl.text = str(userSkllPnts)
func _on_chr_minu_pressed():
if userChr > 10:
userChr -= 1
userSkllPnts += 1
updateChr()
func _on_chr_plus_pressed():
if userSkllPnts > 0:
userChr += 1
userSkllPnts -= 1
updateChr()
func updateChr():
chrLbl.text = str(userChr)
skllPntsLbl.text = str(userSkllPnts)
func _on_prc_btn_pressed():
var userStats = get_node("/root/Stats")
userStats.userStr = userStr
userStats.userDex = userDex
userStats.userInt = userInt
userStats.userChr = userChr
userStats.userSkllPnts = userSkllPnts
var startGame = preload("res://start_game.gd")
startGame.newGame = false
get_tree().change_scene_to_file("res://Game.tscn")