From 4dbbea31e42aad3941811433ec465a8cf2395b53 Mon Sep 17 00:00:00 2001 From: the me Date: Mon, 22 Aug 2022 23:49:38 -0700 Subject: [PATCH] combat forecast, baby --- eastern flames/objects/o_unit/Create_0.gml | 3 +- eastern flames/objects/o_unit/Draw_0.gml | 2 +- eastern flames/objects/o_unit/Draw_64.gml | 1 + eastern flames/objects/o_unit/o_unit.yy | 1 + .../scripts/c_moveunit/c_moveunit.gml | 3 +- .../scripts/st_moving/st_moving.gml | 44 ++++++++++++++++--- eastern flames/scripts/weapon/weapon.gml | 2 +- .../scripts/x_bunnies/x_bunnies.gml | 6 +-- 8 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 eastern flames/objects/o_unit/Draw_64.gml diff --git a/eastern flames/objects/o_unit/Create_0.gml b/eastern flames/objects/o_unit/Create_0.gml index 3dc2e4c..4850b51 100644 --- a/eastern flames/objects/o_unit/Create_0.gml +++ b/eastern flames/objects/o_unit/Create_0.gml @@ -15,6 +15,7 @@ waiting = false; targeting = new vec2(0, 0); hitpos = new vec2(0, 0); marked = false; +hitting = noone; continuecombat = function(me, them) { //if stamina returnable = true stamina-- return true @@ -28,7 +29,7 @@ continuecombat = function(me, them) { action = { effect: function(me, them) { if irandom(99) < (me.data.hit.val) { //add avo - them.data.hp.val -= me.data.str.val; + them.data.hp.val -= (me.data.str.val-them.data.def.val); return me.data.str.val; } else { log(string(me) + " missed!"); diff --git a/eastern flames/objects/o_unit/Draw_0.gml b/eastern flames/objects/o_unit/Draw_0.gml index 2c9da58..275ce9d 100644 --- a/eastern flames/objects/o_unit/Draw_0.gml +++ b/eastern flames/objects/o_unit/Draw_0.gml @@ -12,7 +12,7 @@ var tempy = y; x = 0; y = 0; draw_self(); -drawstate(); + x = tempx; y = tempy; //log(data); diff --git a/eastern flames/objects/o_unit/Draw_64.gml b/eastern flames/objects/o_unit/Draw_64.gml new file mode 100644 index 0000000..6c4a589 --- /dev/null +++ b/eastern flames/objects/o_unit/Draw_64.gml @@ -0,0 +1 @@ +drawstate(); \ No newline at end of file diff --git a/eastern flames/objects/o_unit/o_unit.yy b/eastern flames/objects/o_unit/o_unit.yy index 8ab8751..db49542 100644 --- a/eastern flames/objects/o_unit/o_unit.yy +++ b/eastern flames/objects/o_unit/o_unit.yy @@ -21,6 +21,7 @@ {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, {"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, ], "properties": [], "overriddenProperties": [], diff --git a/eastern flames/scripts/c_moveunit/c_moveunit.gml b/eastern flames/scripts/c_moveunit/c_moveunit.gml index ac0524a..c9d8d8d 100644 --- a/eastern flames/scripts/c_moveunit/c_moveunit.gml +++ b/eastern flames/scripts/c_moveunit/c_moveunit.gml @@ -1,6 +1,7 @@ function c_moveunit(targetunit, destination) { var theguy = c_gettile(targetunit.pos.x, targetunit.pos.y); - array_remove(theguy.contents, targetunit); + log(theguy.contents); + if !array_remove(theguy.contents, targetunit) idhfnjg(); array_push(destination.contents, targetunit); targetunit.pos.x = destination.x; targetunit.pos.y = destination.y; diff --git a/eastern flames/scripts/st_moving/st_moving.gml b/eastern flames/scripts/st_moving/st_moving.gml index e675678..0870019 100644 --- a/eastern flames/scripts/st_moving/st_moving.gml +++ b/eastern flames/scripts/st_moving/st_moving.gml @@ -99,7 +99,7 @@ function st_moving() { } } } - var hitting = noone; + hitting = noone; if guy != noone { hitting = c_gettile(guy.x+hitpos.x, guy.y+hitpos.y); switch dir { @@ -125,15 +125,15 @@ function st_moving() { } if hitting != noone && stop c_colortile(hitting.x, hitting.y, c_red); if hitting != noone && select && stop { - log("found one"); - log(hitting.contents, hitting.x, hitting.y); + //log("found one"); + //log(hitting.contents, hitting.x, hitting.y); var i; for (i=0; i them.data.spd.val+5 ? " x 2" : "")); + draw_text(320, 280, "POW"); + draw_text(320+60, 280, string(them.data.str.val - data.def.val) + (them.data.spd.val > data.spd.val+5 ? " x 2" : "")); + + draw_text(320-60, 315, data.hit.val); + draw_text(320, 315, "HIT"); + draw_text(320+60, 315, them.data.hit.val); + + + draw_set_halign(fa_left); + draw_set_valign(fa_top); + } + } + } + } + } } #macro ts global.tilesize diff --git a/eastern flames/scripts/weapon/weapon.gml b/eastern flames/scripts/weapon/weapon.gml index 5691d97..ca63800 100644 --- a/eastern flames/scripts/weapon/weapon.gml +++ b/eastern flames/scripts/weapon/weapon.gml @@ -47,7 +47,7 @@ nu weapon("Lunar Machete", "sick", WPTYPE.SWORD, [new statmod(st.str, 9, add), n nu weapon("Glock", "gang shit", WPTYPE.SWORD, [new statmod(st.str, 4, add), new statmod(st.hit, 95, add)]); nu weapon("Sniper Rifle", "gang shit", WPTYPE.SWORD, [new statmod(st.str, 11, add), new statmod(st.hit, 100, add)]); -nu weapon("Bottle", "it was full, just a minute ago...", WPTYPE.SWORD, [new statmod(st.str, 10, add), new statmod(st.hit, 30, add)]); +nu weapon("Bottle", "it was full, just a minute ago...", WPTYPE.SWORD, [new statmod(st.str, 10, add), new statmod(st.hit, 33, add)]); function c_modifierreset(target) { var dudes = variable_struct_get_names(target.data); diff --git a/eastern flames/scripts/x_bunnies/x_bunnies.gml b/eastern flames/scripts/x_bunnies/x_bunnies.gml index 5d862d4..b68ee44 100644 --- a/eastern flames/scripts/x_bunnies/x_bunnies.gml +++ b/eastern flames/scripts/x_bunnies/x_bunnies.gml @@ -64,7 +64,7 @@ mydata = { face: s_bunnyface, aitype: AI.KILLER, } -nu unit(mydata, mydata, [st.hp.add(25), st.str.add(6), st.def.add(7), st.spd.add(6), st.mov.add(4), st.hit.add(0), st.rng.add(1)]); +nu unit(mydata, mydata, [st.hp.add(25), st.str.add(6), st.def.add(7), st.spd.add(6), st.mov.add(2), st.hit.add(0), st.rng.add(1)]); mydata = { name: "Plains Bunny", desc: "", @@ -75,7 +75,7 @@ mydata = { face: s_bunnyface, aitype: AI.KILLER, } -nu unit(mydata, mydata, [st.hp.add(25), st.str.add(6), st.def.add(7), st.spd.add(6), st.mov.add(4), st.hit.add(0), st.rng.add(1)]); +nu unit(mydata, mydata, [st.hp.add(25), st.str.add(6), st.def.add(7), st.spd.add(6), st.mov.add(2), st.hit.add(0), st.rng.add(1)]); mydata = { name: "Mountain Bunny", desc: "", @@ -86,7 +86,7 @@ mydata = { face: s_bunnyface, aitype: AI.KILLER, } -nu unit(mydata, mydata, [st.hp.add(25), st.str.add(6), st.def.add(7), st.spd.add(6), st.mov.add(4), st.hit.add(0), st.rng.add(1)]); +nu unit(mydata, mydata, [st.hp.add(25), st.str.add(6), st.def.add(7), st.spd.add(6), st.mov.add(2), st.hit.add(0), st.rng.add(1)]); mydata = { name: "Bunny Buddy", desc: "",