Skip to content

Commit e8d4761

Browse files
committed
bullet improvements (v1.13.1+2)
- change grazing behavior completely to be more accurate to DR - added enum BULLET_COLOR which contains three options: SOLID, BLUE and ORANGE - adjusted grazing points for bullets - implemented individual time points system for bullets - added comments in `o_enc_bullet` to better explain all variables
1 parent c04630c commit e8d4761

10 files changed

Lines changed: 77 additions & 41 deletions

File tree

objects/o_enc_bullet/Create_0.gml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
color = 0
2-
graze = 1
3-
att = 6
4-
inv = ENC_SETUP_SOUL_INV
5-
destroy = true
6-
element = ""
1+
enum BULLET_COLOR {
2+
SOLID,
3+
BLUE,
4+
ORANGE
5+
}
76

8-
inside = false
7+
graze = 2; // how many graze points the bullet should give upon first contact
8+
att = 6; // what attack stat to base the damage off
9+
inv = ENC_SETUP_SOUL_INV; // how many invincibility frames the bullet should give upon damage
10+
time_points = 5; // how many time points the bullet should award for grazing (reduce turn length)
11+
12+
color = BULLET_COLOR.SOLID; // the color of the bullet
13+
destroy = true; // whether the bullet should be destroyed after being hit
14+
element = ""; // the element the bullet uses. for element reduction
15+
inside = false; // whether the bullet should be drawn inside the box

objects/o_enc_bullet/Other_10.gml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
if o_enc_soul.i_frames > 0
22
exit
33

4-
if color == 1
4+
if color == BULLET_COLOR.BLUE
55
if !o_enc_soul.moving
66
exit
7-
else if color == 2
7+
else if color == BULLET_COLOR.ORANGE
88
if o_enc_soul.moving
99
exit
1010

@@ -13,5 +13,5 @@ o_enc_soul.image_index = 1
1313

1414
party_attack_targets(att, o_enc, element)
1515

16-
if color == 0 && destroy
16+
if color == BULLET_COLOR.SOLID && destroy
1717
instance_destroy()

objects/o_enc_bullet/Other_11.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// @description draw
2-
if color == 1
2+
if color == BULLET_COLOR.BLUE
33
image_blend = c_aqua
4-
if color == 2
4+
if color == BULLET_COLOR.ORANGE
55
image_blend = c_orange
66

77
draw_self()

objects/o_enc_soul_grazer/Create_0.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
graze_buffer = 0;
2+
graze_new_buffer = 0;
23
grazed_inst = noone;
4+
grazed_previous = noone;
35
can_graze = false;
46

57
image_alpha = 0;
Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
/// @desc
2-
if grazed_inst.color != 0
3-
exit
2+
if grazed_inst.color != BULLET_COLOR.SOLID
3+
exit;
44

5-
o_enc.tp += grazed_inst.graze
6-
o_enc.tp = clamp(o_enc.tp, 0, 100)
7-
8-
for (var i = 0; i < array_length(o_enc.turn_objects); i ++) {
9-
if instance_exists(o_enc.turn_objects[i]) && enc_enemy_isfighting(i) && o_enc.turn_objects[i].shorten_by_tension && is_real(o_enc.turn_objects[i].timer_end) {
10-
o_enc.turn_objects[i].timer_end -= 2
11-
12-
if item_get_equipped(item_a_silver_watch)
13-
o_enc.turn_objects[i].timer_end -= .1
14-
}
5+
if grazed_inst != grazed_previous {
6+
o_enc.tp += grazed_inst.graze;
7+
o_enc.tp = clamp(o_enc.tp, 0, 100);
8+
9+
if grazed_inst.time_points > 0
10+
for (var i = 0; i < array_length(o_enc.turn_objects); i ++) {
11+
if instance_exists(o_enc.turn_objects[i]) && enc_enemy_isfighting(i)
12+
&& o_enc.turn_objects[i].shorten_by_tension && is_real(o_enc.turn_objects[i].timer_end)
13+
&& o_enc.turn_objects[i].timer_end - o_enc.turn_objects[i].timer > 10
14+
{
15+
o_enc.turn_objects[i].timer_end -= grazed_inst.time_points;
16+
if item_get_equipped(item_a_silver_watch)
17+
o_enc.turn_objects[i].timer_end -= grazed_inst.time_points * .1;
18+
}
19+
}
20+
21+
audio_play(snd_graze);
22+
23+
image_index = 0;
24+
image_alpha = 1;
25+
graze_new_buffer = 5;
1526
}
16-
17-
audio_play(snd_graze)
18-
19-
image_index = 0;
20-
image_alpha = 1
27+
else {
28+
o_enc.tp += grazed_inst.graze/12;
29+
o_enc.tp = clamp(o_enc.tp, 0, 100);
30+
31+
if grazed_inst.time_points > 0
32+
for (var i = 0; i < array_length(o_enc.turn_objects); i ++) {
33+
if instance_exists(o_enc.turn_objects[i]) && enc_enemy_isfighting(i)
34+
&& o_enc.turn_objects[i].shorten_by_tension && is_real(o_enc.turn_objects[i].timer_end)
35+
&& o_enc.turn_objects[i].timer_end - o_enc.turn_objects[i].timer > 10
36+
{
37+
o_enc.turn_objects[i].timer_end -= grazed_inst.time_points/30;
38+
}
39+
}
40+
}
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
if can_graze == true && o_enc.turn_timer > 10 {
22
if graze_buffer > 0
3-
graze_buffer--;
3+
graze_buffer --;
44
else {
55
graze_buffer = 0;
66
grazed_inst = noone;
77
}
88

9-
if (graze_buffer == 0 && place_meeting(x, y, grazed_inst))
10-
|| (instance_place(x, y, o_enc_bullet) != grazed_inst
11-
&& place_meeting(x,y,o_enc_bullet)) {
9+
if (graze_buffer == 0 && place_meeting(x, y, grazed_inst))
10+
|| instance_place(x, y, o_enc_bullet) != grazed_inst {
1211
if instance_exists(instance_place(x, y, o_enc_bullet))
13-
&& instance_place(x, y, o_enc_bullet).color == 0
12+
&& instance_place(x, y, o_enc_bullet).color == BULLET_COLOR.SOLID
1413
&& instance_place(x, y, o_enc_bullet).graze > 0 {
1514
grazed_inst = instance_place(x, y, o_enc_bullet);
1615
event_user(0);
@@ -19,7 +18,7 @@ if can_graze == true && o_enc.turn_timer > 10 {
1918
}
2019
}
2120

22-
if grazed_inst != noone {
21+
if grazed_inst != noone && graze_new_buffer > 0 {
2322
if image_index < 3 {
2423
image_index += 0.67;
2524
image_alpha = 1;
@@ -29,5 +28,12 @@ if grazed_inst != noone {
2928
image_alpha = 0;
3029
}
3130
}
31+
else if grazed_inst != noone && graze_new_buffer <= 0 {
32+
image_alpha = max(image_alpha, .35);
33+
}
34+
35+
image_alpha -= 0.1;
3236

33-
image_alpha -= 0.1
37+
grazed_previous = grazed_inst;
38+
if graze_new_buffer > 0
39+
graze_new_buffer --
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
event_inherited()
22
att = 6
33
path = undefined
4-
inv = 10
4+
inv = 10
5+
graze = .5;

scripts/game_info/game_info.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#macro GAME_VERSION "v1.12.2+1"
1+
#macro GAME_VERSION "v1.13.1+2"
22
#macro GAME_NAME "tlDR Engine"
33
#macro GAME_LAST_COMPATIBLE_VERSION "v1.12.0" // last compatible save version
44

scripts/macro_depth/macro_depth.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum DEPTH_ENCOUNTER {
1111
ACTORS = -6100,
1212
BULLETS_INSIDE = -6200,
1313
BOX = -6300,
14-
BULLETS_OUTSIDE = -6400,
15-
SOUL = -6500,
14+
SOUL = -6400,
15+
BULLETS_OUTSIDE = -6500,
1616
UI = -7000,
1717
}

tldr-engine.yyp

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)