diff --git a/eastern flames/eastern flames.yyp b/eastern flames/eastern flames.yyp index 37f66f6..e7ece53 100644 --- a/eastern flames/eastern flames.yyp +++ b/eastern flames/eastern flames.yyp @@ -6,6 +6,7 @@ {"id":{"name":"clampneg","path":"scripts/clampneg/clampneg.yy",},"order":8,}, {"id":{"name":"array_remove","path":"scripts/array_remove/array_remove.yy",},"order":6,}, {"id":{"name":"lerp_angle","path":"scripts/lerp_angle/lerp_angle.yy",},"order":9,}, + {"id":{"name":"c_getstats","path":"scripts/c_getstats/c_getstats.yy",},"order":16,}, {"id":{"name":"stat","path":"scripts/stat/stat.yy",},"order":3,}, {"id":{"name":"vlambeer","path":"scripts/vlambeer/vlambeer.yy",},"order":1,}, {"id":{"name":"x_unitsetup","path":"scripts/x_unitsetup/x_unitsetup.yy",},"order":0,}, @@ -50,6 +51,7 @@ {"id":{"name":"song","path":"scripts/song/song.yy",},"order":1,}, {"id":{"name":"cpp","path":"scripts/cpp/cpp.yy",},"order":1,}, {"id":{"name":"log","path":"scripts/log/log.yy",},"order":10,}, + {"id":{"name":"c_fulleval","path":"scripts/c_fulleval/c_fulleval.yy",},"order":18,}, {"id":{"name":"keyboard_check_advanced","path":"scripts/keyboard_check_advanced/keyboard_check_advanced.yy",},"order":8,}, {"id":{"name":"collision_line_width","path":"scripts/collision_line_width/collision_line_width.yy",},"order":9,}, {"id":{"name":"draw_rectangle_width","path":"scripts/draw_rectangle_width/draw_rectangle_width.yy",},"order":7,}, @@ -63,6 +65,7 @@ {"id":{"name":"c_input","path":"scripts/c_input/c_input.yy",},"order":8,}, {"id":{"name":"st_standing","path":"scripts/st_standing/st_standing.yy",},"order":6,}, {"id":{"name":"unit","path":"scripts/unit/unit.yy",},"order":2,}, + {"id":{"name":"c_moveunit","path":"scripts/c_moveunit/c_moveunit.yy",},"order":17,}, {"id":{"name":"se_play","path":"scripts/se_play/se_play.yy",},"order":5,}, {"id":{"name":"msglang","path":"scripts/msglang/msglang.yy",},"order":15,}, {"id":{"name":"array_front","path":"scripts/array_front/array_front.yy",},"order":2,}, diff --git a/eastern flames/objects/ARTICULATOR/ARTICULATOR.yy b/eastern flames/objects/ARTICULATOR/ARTICULATOR.yy index 20cef4a..79f59ad 100644 --- a/eastern flames/objects/ARTICULATOR/ARTICULATOR.yy +++ b/eastern flames/objects/ARTICULATOR/ARTICULATOR.yy @@ -18,7 +18,7 @@ "physicsKinematic": false, "physicsShapePoints": [], "eventList": [ - {"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",}, {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, {"isDnD":false,"eventNum":72,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, diff --git a/eastern flames/objects/ARTICULATOR/Create_0.gml b/eastern flames/objects/ARTICULATOR/Create_0.gml index b518530..6353d5c 100644 --- a/eastern flames/objects/ARTICULATOR/Create_0.gml +++ b/eastern flames/objects/ARTICULATOR/Create_0.gml @@ -3,7 +3,12 @@ var i; /*for (i=0; i global.gw-100 { + var guyhits = floor(abs(mouse_y-global.gh-10)/32); + log(guyhits, array_length(selectedunit.inventory)); + if guyhits < array_length(selectedunit.inventory) { + //log("doing"); + selectedunit.equippedweapon = guyhits+1; + c_equipweapon(selectedunit, selectedunit.inventory[selectedunit.equippedweapon]); + } + //draw_text(global.gw-10, global.gh-10-i*20; + } +} + +var mousex = floor(mouse_x/global.tilesize.x); +var mousey = floor(mouse_y/global.tilesize.y); +//log(mousex, mousey); +hoveredunit = selectedunit; +if mousex < array_length(global.map) { + if mousey < array_length(global.map[mousex]) { + var i; + for (i=0; i= array_length(dudes) break; + } + if i >= array_length(dudes) break; + array_push(chaps, target.data[$dudes[i]]); + } + return chaps; +} \ No newline at end of file diff --git a/eastern flames/scripts/c_getstats/c_getstats.yy b/eastern flames/scripts/c_getstats/c_getstats.yy new file mode 100644 index 0000000..aced597 --- /dev/null +++ b/eastern flames/scripts/c_getstats/c_getstats.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, + "resourceVersion": "1.0", + "name": "c_getstats", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/eastern flames/scripts/c_moveunit/c_moveunit.gml b/eastern flames/scripts/c_moveunit/c_moveunit.gml new file mode 100644 index 0000000..b83b600 --- /dev/null +++ b/eastern flames/scripts/c_moveunit/c_moveunit.gml @@ -0,0 +1,7 @@ +function c_moveunit(targetunit, destination) { + array_remove(c_gettile(targetunit.pos.x, targetunit.pos.y).contents, targetunit); + array_push(destination.contents, targetunit); + targetunit.pos.x = destination.x; + targetunit.pos.y = destination.y; + +} \ No newline at end of file diff --git a/eastern flames/scripts/c_moveunit/c_moveunit.yy b/eastern flames/scripts/c_moveunit/c_moveunit.yy new file mode 100644 index 0000000..affe33a --- /dev/null +++ b/eastern flames/scripts/c_moveunit/c_moveunit.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, + "resourceVersion": "1.0", + "name": "c_moveunit", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/eastern flames/scripts/c_selectunit/c_selectunit.gml b/eastern flames/scripts/c_selectunit/c_selectunit.gml index f10f270..b51c9f3 100644 --- a/eastern flames/scripts/c_selectunit/c_selectunit.gml +++ b/eastern flames/scripts/c_selectunit/c_selectunit.gml @@ -1,8 +1,9 @@ function c_selectunit(unitobject) { + if unitobject.waiting return false unitobject.state = st_moving; unitobject.drawstate = st_movingdraw; unitobject.returnpos = new vec2(unitobject.pos.x, unitobject.pos.y); - var mov = 2//DONT + var mov = unitobject.data.mov.val; var i, j; for (i=-mov; i<=mov; i++) { for (j=-mov; j<=mov; j++) { @@ -12,6 +13,8 @@ function c_selectunit(unitobject) { } } ARTICULATOR.selectedunit = unitobject; + c_fulleval(unitobject); + return unitobject; } function c_deselectunit(unitobject) { @@ -23,6 +26,7 @@ function c_deselectunit(unitobject) { c_decolor_all(c_red); c_decolor_all(c_green); ARTICULATOR.selectedunit = noone; + c_fulleval(unitobject); return true; } diff --git a/eastern flames/scripts/st_moving/st_moving.gml b/eastern flames/scripts/st_moving/st_moving.gml index f078d48..726d650 100644 --- a/eastern flames/scripts/st_moving/st_moving.gml +++ b/eastern flames/scripts/st_moving/st_moving.gml @@ -1,9 +1,9 @@ function st_moving() { - var mov = 2; + var mov = data.mov.val; c_input(); hspd = lerp(hspd, (right-left)*.05, .4); vspd = lerp(vspd, (down-up)*.05, .4); - //if !stop dir = DIR.NONE; + if !stop dir = DIR.NONE; if left dir = DIR.LEFT; if down dir = DIR.DOWN; if up dir = DIR.UP; @@ -47,7 +47,7 @@ function st_moving() { //var rng = [1]; var guy = c_gettile(x, y, true); var hitting = noone; - if guy != noone { + if guy != noone && stop { switch dir { case DIR.LEFT: hitting = c_gettile(guy.x-1, guy.y); @@ -96,6 +96,11 @@ function st_moving() { if back { c_deselectunit(id); } + if dir == DIR.NONE && select { + c_moveunit(id, c_gettile(x, y, true)); + waiting = true; + c_deselectunit(id); + } /*if x < (pos.x-mov)*ts.x { x = (pos.x-mov)*ts.x; } else if x > (pos.x+mov+1)*ts.x { diff --git a/eastern flames/scripts/stat/stat.gml b/eastern flames/scripts/stat/stat.gml index 915f166..6d8cb8a 100644 --- a/eastern flames/scripts/stat/stat.gml +++ b/eastern flames/scripts/stat/stat.gml @@ -44,4 +44,6 @@ function modulo(val1, val2) { nu stat("hp", "health", "vitality"); nu stat("str", "strength", "physical power"); nu stat("def", "defense", "physical defense"); -nu stat("spd", "speed", "avoid and follow-up"); \ No newline at end of file +nu stat("spd", "speed", "avoid and follow-up"); +nu stat("hit", "hit rate", "chance to hit"); +nu stat("mov", "movement", "distance travelable"); \ No newline at end of file diff --git a/eastern flames/scripts/tiledata/tiledata.gml b/eastern flames/scripts/tiledata/tiledata.gml index d8ecfd4..7bd2efd 100644 --- a/eastern flames/scripts/tiledata/tiledata.gml +++ b/eastern flames/scripts/tiledata/tiledata.gml @@ -7,7 +7,7 @@ global.map = [ [new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], [new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], [new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], -[new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], +[new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(u, u, [c_lime], [new statmod(st.def, 5, add)]), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], [new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], [new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], [new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata(), new tiledata()], @@ -26,8 +26,13 @@ function c_informtiles() { c_informtiles(); global.tilesize = new vec2(32, 32); -function tiledata(passable_=true) constructor { - passable = passable; - contents = []; - overlays = []; +function tiledata(passable_=true, contents_=[], overlays_=[], statmods=[]) constructor { + passable = passable_; + contents = contents_; + overlays = overlays_; + modifiers = {}; + var i; + for (i=0; i