damage calculation (wip)

This commit is contained in:
Page Asgardius 2024-05-15 15:51:17 -07:00
parent 02ab2a38e9
commit dc061b2dea
9 changed files with 122 additions and 34 deletions

View file

@ -28,6 +28,8 @@ const pbbullets = ["res://sprites/common/bullet/fireball.tscn", "res://sprites/c
const pcspecialities = [1, 2, null, 3, null, null, null, null, null, 0] const pcspecialities = [1, 2, null, 3, null, null, null, null, null, 0]
const pchars = [["res://sprites/common/midori/sprite.png"], ["res://sprites/common/tuna/sprite.png"], [null], ["res://sprites/common/kimberly/sprite.png"], [null], [null], [null], [null], [null], ["res://sprites/common/natasha/sprite.png"]] const pchars = [["res://sprites/common/midori/sprite.png"], ["res://sprites/common/tuna/sprite.png"], [null], ["res://sprites/common/kimberly/sprite.png"], [null], [null], [null], [null], [null], ["res://sprites/common/natasha/sprite.png"]]
const npchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"] const npchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"]
var cboss = [null, null, null]
var isboss
var party = [[0,0], [1,0], [9,0], [3,0]] var party = [[0,0], [1,0], [9,0], [3,0]]
const specialities = [2, 0, 3, 1, 5, 4] const specialities = [2, 0, 3, 1, 5, 4]
var dparty = [[0,0], [1,0], [9,0], [3,0]] var dparty = [[0,0], [1,0], [9,0], [3,0]]

View file

@ -5,7 +5,6 @@ var music
var bgsound := AudioStreamPlayer.new() var bgsound := AudioStreamPlayer.new()
var sfx1 := AudioStreamPlayer.new() var sfx1 := AudioStreamPlayer.new()
var musictrack var musictrack
var isboss
var bhud = load("res://levels/bottomhud.tscn").instantiate() var bhud = load("res://levels/bottomhud.tscn").instantiate()
var thud = load("res://levels/ui/tophud.tscn").instantiate() var thud = load("res://levels/ui/tophud.tscn").instantiate()
var ishud = true var ishud = true
@ -19,12 +18,12 @@ func _ready():
level = load(Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][0]).instantiate() level = load(Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][0]).instantiate()
#player = load(Global.pchars[Global.dcpchar]).instantiate() #player = load(Global.pchars[Global.dcpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][1]] musictrack = Global.musictracks[Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][1]]
isboss = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2] Global.isboss = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2]
else: else:
level = load(Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][0]).instantiate() level = load(Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][0]).instantiate()
# player = load(Global.pchars[Global.cpchar]).instantiate() # player = load(Global.pchars[Global.cpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][1]] musictrack = Global.musictracks[Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][1]]
isboss = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2] Global.isboss = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2]
#if Global.cspawnarea[0] != null && Global.cspawnarea[0] != null: #if Global.cspawnarea[0] != null && Global.cspawnarea[0] != null:
# player.position.x = Global.cspawnarea[0] # player.position.x = Global.cspawnarea[0]
# player.position.y = Global.cspawnarea[1] # player.position.y = Global.cspawnarea[1]
@ -40,7 +39,7 @@ func _ready():
get_tree().root.add_child.call_deferred(thud) get_tree().root.add_child.call_deferred(thud)
#get_tree().root.add_child.call_deferred(player) #get_tree().root.add_child.call_deferred(player)
bgsound.stream = music bgsound.stream = music
if !isboss: if !Global.isboss:
bgsound.play(0) bgsound.play(0)
@ -69,6 +68,7 @@ func _input(event):
if (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK)) && Global.cdialog == []: if (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK)) && Global.cdialog == []:
Global.live = 0 Global.live = 0
Global.bossready = false Global.bossready = false
Global.cboss = [null, null, null]
get_tree().root.remove_child(thud) get_tree().root.remove_child(thud)
get_tree().root.remove_child(bhud) get_tree().root.remove_child(bhud)
get_tree().root.remove_child(player) get_tree().root.remove_child(player)

View file

@ -47,6 +47,11 @@ var bskill3
var bhealth4 var bhealth4
var bstamina4 var bstamina4
var bskill4 var bskill4
var bboss
var cboss
var nboss
var boss
var bossbg
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
@ -98,6 +103,11 @@ func _ready():
bhealth4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer2/ProgressBar bhealth4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer2/ProgressBar
bstamina4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer3/ProgressBar bstamina4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer3/ProgressBar
bskill4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer4/ProgressBar bskill4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer4/ProgressBar
bboss = $CanvasLayer/Boss/HBoxContainer2/ProgressBar
cboss = $CanvasLayer/Boss/HBoxContainer2/Label2
nboss = $CanvasLayer/Boss/HBoxContainer/Label
boss = $CanvasLayer/Boss
bossbg = $CanvasLayer/Bossbg
topleft.visible = false topleft.visible = false
topleftbg.visible = false topleftbg.visible = false
if Global.mangohud: if Global.mangohud:
@ -105,17 +115,28 @@ func _ready():
topleftbg.position.y = 244 topleftbg.position.y = 244
topmini.position.y = 601 topmini.position.y = 601
topminibg.position.y = 601 topminibg.position.y = 601
if Global.cboss == [null, null, null]:
bossbg.visible = false
boss.visible = false
else:
bossbg.visible = true
boss.visible = true
nboss.set_text(Global.cboss[0])
if Global.cboss[2] != 0:
bboss.value = (Global.cboss[1] * 100) / Global.cboss[2]
cboss.set_text(str(Global.cboss[1])+"/"+str(Global.cboss[2]))
_charrefresh() _charrefresh()
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(delta):
if Global.debug: if Global.debug:
chealthf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][0])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][0])) chealthf.set_text(str(Global.dstats[Global.dparty[Global.dcpchar][0]][0])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][0]))
cstaminaf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][1])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][1])) cstaminaf.set_text(str(Global.dstats[Global.dparty[Global.dcpchar][0]][1])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][1]))
cskillf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][4])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][4])) cskillf.set_text(str(Global.dstats[Global.dparty[Global.dcpchar][0]][4])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][4]))
bhealthf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][0] * 100) / Global.mstats[Global.dparty[Global.dcpchar][0]][0] bhealthf.value = (Global.dstats[Global.dparty[Global.dcpchar][0]][0] * 100) / Global.mstats[Global.dparty[Global.dcpchar][0]][0]
bstaminaf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][1] * 100) / Global.mstats[Global.dparty[Global.dcpchar][0]][1] bstaminaf.value = (Global.dstats[Global.dparty[Global.dcpchar][0]][1] * 100) / Global.mstats[Global.dparty[Global.dcpchar][0]][1]
bskillf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][4] * 100) / Global.mstats[Global.dparty[Global.dcpchar][0]][4] bskillf.value = (Global.dstats[Global.dparty[Global.dcpchar][0]][4] * 100) / Global.mstats[Global.dparty[Global.dcpchar][0]][4]
else: else:
chealthf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][0])+"/"+str(Global.mstats[Global.dparty[Global.cpchar][0]][0])) chealthf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][0])+"/"+str(Global.mstats[Global.dparty[Global.cpchar][0]][0]))
cstaminaf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][1])+"/"+str(Global.mstats[Global.dparty[Global.cpchar][0]][1])) cstaminaf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][1])+"/"+str(Global.mstats[Global.dparty[Global.cpchar][0]][1]))
@ -126,6 +147,16 @@ func _process(delta):
func _input(event): func _input(event):
if Global.cboss == [null, null, null]:
bossbg.visible = false
boss.visible = false
else:
bossbg.visible = true
boss.visible = true
nboss.set_text(Global.cboss[0])
if Global.cboss[2] != 0:
bboss.value = (Global.cboss[1] * 100) / Global.cboss[2]
cboss.set_text(str(Global.cboss[1])+"/"+str(Global.cboss[2]))
if Input.is_action_just_pressed("schar"): if Input.is_action_just_pressed("schar"):
topleft.visible = true topleft.visible = true
topleftbg.visible = true topleftbg.visible = true
@ -139,12 +170,12 @@ func _charrefresh():
if Global.dparty[0][0] != null: if Global.dparty[0][0] != null:
cn1.set_text(Global.pcnames[Global.dparty[0][0]]) cn1.set_text(Global.pcnames[Global.dparty[0][0]])
cf1.texture = load(Global.hudfaces[Global.dparty[0][0]][Global.dparty[0][1]]) cf1.texture = load(Global.hudfaces[Global.dparty[0][0]][Global.dparty[0][1]])
chealth1.set_text(str(Global.cstats[Global.dparty[0][0]][0])+"/"+str(Global.mstats[Global.dparty[0][0]][0])) chealth1.set_text(str(Global.dstats[Global.dparty[0][0]][0])+"/"+str(Global.mstats[Global.dparty[0][0]][0]))
cstamina1.set_text(str(Global.cstats[Global.dparty[0][0]][1])+"/"+str(Global.mstats[Global.dparty[0][0]][1])) cstamina1.set_text(str(Global.dstats[Global.dparty[0][0]][1])+"/"+str(Global.mstats[Global.dparty[0][0]][1]))
cskill1.set_text(str(Global.cstats[Global.dparty[0][0]][4])+"/"+str(Global.mstats[Global.dparty[0][0]][4])) cskill1.set_text(str(Global.dstats[Global.dparty[0][0]][4])+"/"+str(Global.mstats[Global.dparty[0][0]][4]))
bhealth1.value = (Global.cstats[Global.dparty[0][0]][0] * 100) / Global.mstats[Global.dparty[0][0]][0] bhealth1.value = (Global.dstats[Global.dparty[0][0]][0] * 100) / Global.mstats[Global.dparty[0][0]][0]
bstamina1.value = (Global.cstats[Global.dparty[0][0]][1] * 100) / Global.mstats[Global.dparty[0][0]][1] bstamina1.value = (Global.dstats[Global.dparty[0][0]][1] * 100) / Global.mstats[Global.dparty[0][0]][1]
bskill1.value = (Global.cstats[Global.dparty[0][0]][4] * 100) / Global.mstats[Global.dparty[0][0]][4] bskill1.value = (Global.dstats[Global.dparty[0][0]][4] * 100) / Global.mstats[Global.dparty[0][0]][4]
if Global.dcpchar == 0: if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1)) focus1.set_color(Color(0, 0, 1, 1))
else: else:
@ -162,12 +193,12 @@ func _charrefresh():
if Global.dparty[1][0] != null: if Global.dparty[1][0] != null:
cn2.set_text(Global.pcnames[Global.dparty[1][0]]) cn2.set_text(Global.pcnames[Global.dparty[1][0]])
cf2.texture = load(Global.hudfaces[Global.dparty[1][0]][Global.dparty[1][1]]) cf2.texture = load(Global.hudfaces[Global.dparty[1][0]][Global.dparty[1][1]])
chealth2.set_text(str(Global.cstats[Global.dparty[1][0]][0])+"/"+str(Global.mstats[Global.dparty[1][0]][0])) chealth2.set_text(str(Global.dstats[Global.dparty[1][0]][0])+"/"+str(Global.mstats[Global.dparty[1][0]][0]))
cstamina2.set_text(str(Global.cstats[Global.dparty[1][0]][1])+"/"+str(Global.mstats[Global.dparty[1][0]][1])) cstamina2.set_text(str(Global.dstats[Global.dparty[1][0]][1])+"/"+str(Global.mstats[Global.dparty[1][0]][1]))
cskill2.set_text(str(Global.cstats[Global.dparty[1][0]][4])+"/"+str(Global.mstats[Global.dparty[1][0]][4])) cskill2.set_text(str(Global.dstats[Global.dparty[1][0]][4])+"/"+str(Global.mstats[Global.dparty[1][0]][4]))
bhealth2.value = (Global.cstats[Global.dparty[1][0]][0] * 100) / Global.mstats[Global.dparty[1][0]][0] bhealth2.value = (Global.dstats[Global.dparty[1][0]][0] * 100) / Global.mstats[Global.dparty[1][0]][0]
bstamina2.value = (Global.cstats[Global.dparty[1][0]][1] * 100) / Global.mstats[Global.dparty[1][0]][1] bstamina2.value = (Global.dstats[Global.dparty[1][0]][1] * 100) / Global.mstats[Global.dparty[1][0]][1]
bskill2.value = (Global.cstats[Global.dparty[1][0]][4] * 100) / Global.mstats[Global.dparty[1][0]][4] bskill2.value = (Global.dstats[Global.dparty[1][0]][4] * 100) / Global.mstats[Global.dparty[1][0]][4]
if Global.dcpchar == 1: if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1)) focus2.set_color(Color(0, 0, 1, 1))
else: else:
@ -185,12 +216,12 @@ func _charrefresh():
if Global.dparty[2][0] != null: if Global.dparty[2][0] != null:
cn3.set_text(Global.pcnames[Global.dparty[2][0]]) cn3.set_text(Global.pcnames[Global.dparty[2][0]])
cf3.texture = load(Global.hudfaces[Global.dparty[2][0]][Global.dparty[2][1]]) cf3.texture = load(Global.hudfaces[Global.dparty[2][0]][Global.dparty[2][1]])
chealth3.set_text(str(Global.cstats[Global.dparty[2][0]][0])+"/"+str(Global.mstats[Global.dparty[2][0]][0])) chealth3.set_text(str(Global.dstats[Global.dparty[2][0]][0])+"/"+str(Global.mstats[Global.dparty[2][0]][0]))
cstamina3.set_text(str(Global.cstats[Global.dparty[2][0]][1])+"/"+str(Global.mstats[Global.dparty[2][0]][1])) cstamina3.set_text(str(Global.dstats[Global.dparty[2][0]][1])+"/"+str(Global.mstats[Global.dparty[2][0]][1]))
cskill3.set_text(str(Global.cstats[Global.dparty[2][0]][4])+"/"+str(Global.mstats[Global.dparty[2][0]][4])) cskill3.set_text(str(Global.dstats[Global.dparty[2][0]][4])+"/"+str(Global.mstats[Global.dparty[2][0]][4]))
bhealth3.value = (Global.cstats[Global.dparty[2][0]][0] * 100) / Global.mstats[Global.dparty[2][0]][0] bhealth3.value = (Global.dstats[Global.dparty[2][0]][0] * 100) / Global.mstats[Global.dparty[2][0]][0]
bstamina3.value = (Global.cstats[Global.dparty[2][0]][1] * 100) / Global.mstats[Global.dparty[2][0]][1] bstamina3.value = (Global.dstats[Global.dparty[2][0]][1] * 100) / Global.mstats[Global.dparty[2][0]][1]
bskill3.value = (Global.cstats[Global.dparty[2][0]][4] * 100) / Global.mstats[Global.dparty[2][0]][4] bskill3.value = (Global.dstats[Global.dparty[2][0]][4] * 100) / Global.mstats[Global.dparty[2][0]][4]
if Global.dcpchar == 2: if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1)) focus3.set_color(Color(0, 0, 1, 1))
else: else:
@ -208,12 +239,12 @@ func _charrefresh():
if Global.dparty[3][0] != null: if Global.dparty[3][0] != null:
cn4.set_text(Global.pcnames[Global.dparty[3][0]]) cn4.set_text(Global.pcnames[Global.dparty[3][0]])
cf4.texture = load(Global.hudfaces[Global.dparty[3][0]][Global.dparty[3][1]]) cf4.texture = load(Global.hudfaces[Global.dparty[3][0]][Global.dparty[3][1]])
chealth4.set_text(str(Global.cstats[Global.dparty[3][0]][0])+"/"+str(Global.mstats[Global.dparty[3][0]][0])) chealth4.set_text(str(Global.dstats[Global.dparty[3][0]][0])+"/"+str(Global.mstats[Global.dparty[3][0]][0]))
cstamina4.set_text(str(Global.cstats[Global.dparty[3][0]][1])+"/"+str(Global.mstats[Global.dparty[3][0]][1])) cstamina4.set_text(str(Global.dstats[Global.dparty[3][0]][1])+"/"+str(Global.mstats[Global.dparty[3][0]][1]))
cskill4.set_text(str(Global.cstats[Global.dparty[3][0]][4])+"/"+str(Global.mstats[Global.dparty[3][0]][4])) cskill4.set_text(str(Global.dstats[Global.dparty[3][0]][4])+"/"+str(Global.mstats[Global.dparty[3][0]][4]))
bhealth4.value = (Global.cstats[Global.dparty[3][0]][0] * 100) / Global.mstats[Global.dparty[3][0]][0] bhealth4.value = (Global.dstats[Global.dparty[3][0]][0] * 100) / Global.mstats[Global.dparty[3][0]][0]
bstamina4.value = (Global.cstats[Global.dparty[3][0]][1] * 100) / Global.mstats[Global.dparty[3][0]][1] bstamina4.value = (Global.dstats[Global.dparty[3][0]][1] * 100) / Global.mstats[Global.dparty[3][0]][1]
bskill4.value = (Global.cstats[Global.dparty[3][0]][4] * 100) / Global.mstats[Global.dparty[3][0]][4] bskill4.value = (Global.dstats[Global.dparty[3][0]][4] * 100) / Global.mstats[Global.dparty[3][0]][4]
if Global.dcpchar == 3: if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1)) focus4.set_color(Color(0, 0, 1, 1))
else: else:

View file

@ -3,6 +3,8 @@ var velocity: Vector2 = Vector2()
var direction var direction
var speciality var speciality
var btype var btype
var attack
var crit
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
if is_in_group("players"): if is_in_group("players"):
@ -22,6 +24,17 @@ func _on_body_entered(body):if !body.is_in_group(btype):
if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"): if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"):
if body.weakness == speciality: if body.weakness == speciality:
print("weakness") print("weakness")
Input.start_joy_vibration(0,0,1,3)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit
else:
Input.start_joy_vibration(0,1,0,2)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack
#if body.is_in_group("players"): #if body.is_in_group("players"):
# Global.live = 2 # Global.live = 2
#elif body.is_in_group("enemies"): #elif body.is_in_group("enemies"):

View file

@ -5,6 +5,8 @@ var speciality
var speed = 100 var speed = 100
var btype var btype
var isvisible var isvisible
var attack
var crit
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
if is_in_group("players"): if is_in_group("players"):
@ -36,8 +38,16 @@ func _on_body_entered(body):
if body.weakness == speciality: if body.weakness == speciality:
print("weakness") print("weakness")
Input.start_joy_vibration(0,0,1,3) Input.start_joy_vibration(0,0,1,3)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit
else: else:
Input.start_joy_vibration(0,1,0,2) Input.start_joy_vibration(0,1,0,2)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack
elif body.is_in_group("boss") || body.is_in_group("enemies"): elif body.is_in_group("boss") || body.is_in_group("enemies"):
if body.weakness == speciality: if body.weakness == speciality:
print("weakness") print("weakness")

View file

@ -4,6 +4,8 @@ var direction
var speed = 100 var speed = 100
var btype var btype
var isvisible var isvisible
var attack
var crit
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
isvisible = $VisibleOnScreenNotifier2D isvisible = $VisibleOnScreenNotifier2D
@ -29,8 +31,16 @@ func _on_body_entered(body):
if body.weakness == 3: if body.weakness == 3:
print("weakness") print("weakness")
Input.start_joy_vibration(0,0,1,3) Input.start_joy_vibration(0,0,1,3)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit
else: else:
Input.start_joy_vibration(0,1,0,2) Input.start_joy_vibration(0,1,0,2)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack
elif body.is_in_group("boss") || body.is_in_group("enemies"): elif body.is_in_group("boss") || body.is_in_group("enemies"):
if body.weakness == 3: if body.weakness == 3:
print("weakness") print("weakness")

View file

@ -4,6 +4,8 @@ var direction
var speed = 100 var speed = 100
var btype var btype
var isvisible var isvisible
var attack
var crit
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
isvisible = $VisibleOnScreenNotifier2D isvisible = $VisibleOnScreenNotifier2D
@ -29,8 +31,16 @@ func _on_body_entered(body):
if body.weakness == 0: if body.weakness == 0:
print("weakness") print("weakness")
Input.start_joy_vibration(0,0,1,3) Input.start_joy_vibration(0,0,1,3)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack * crit
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack * crit
else: else:
Input.start_joy_vibration(0,1,0,2) Input.start_joy_vibration(0,1,0,2)
if Global.debug:
Global.dstats[Global.dparty[Global.dcpchar][0]][0] -= attack
else:
Global.dstats[Global.party[Global.cpchar][0]][0] -= attack
elif body.is_in_group("boss") || body.is_in_group("enemies"): elif body.is_in_group("boss") || body.is_in_group("enemies"):
if body.weakness == 0: if body.weakness == 0:
print("weakness") print("weakness")

View file

@ -11,9 +11,13 @@ var vangle = 2
var weakness = 1 var weakness = 1
var movex = 0 var movex = 0
var movey = 0 var movey = 0
var attack = 59
var crit = 5
func _ready(): func _ready():
if Global.isboss:
Global.cboss = ["Kimberly Arch",0,0]
var stimer = $Speed var stimer = $Speed
stimer.start(0.05) stimer.start(0.05)
@ -86,6 +90,8 @@ func shoot(angle):
new_bullet.position = Vector2(position.x, position.y) new_bullet.position = Vector2(position.x, position.y)
new_bullet.direction = get_vector(angle) new_bullet.direction = get_vector(angle)
new_bullet.btype = "boss" new_bullet.btype = "boss"
new_bullet.attack = attack
new_bullet.crit = crit
get_parent().call_deferred("add_child",new_bullet) get_parent().call_deferred("add_child",new_bullet)

View file

@ -12,9 +12,13 @@ var weakness = 2
var player var player
var movex = 0 var movex = 0
var movey = 0 var movey = 0
var attack = 87
var crit = 7
func _ready(): func _ready():
if Global.isboss:
Global.cboss = ["Natasha Dostoyevsky",20520,20520]
var stimer = $Speed var stimer = $Speed
stimer.start(0.05) stimer.start(0.05)
#player = get_parent().root.get_node("Player") #player = get_parent().root.get_node("Player")
@ -88,6 +92,8 @@ func shoot(angle):
new_bullet.position = Vector2(position.x, position.y) new_bullet.position = Vector2(position.x, position.y)
new_bullet.direction = get_vector(angle) new_bullet.direction = get_vector(angle)
new_bullet.btype = "boss" new_bullet.btype = "boss"
new_bullet.attack = attack
new_bullet.crit = crit
get_parent().call_deferred("add_child",new_bullet) get_parent().call_deferred("add_child",new_bullet)