diff --git a/eastern flames/eastern flames.yyp b/eastern flames/eastern flames.yyp index 60151ee..cbd4a31 100644 --- a/eastern flames/eastern flames.yyp +++ b/eastern flames/eastern flames.yyp @@ -126,6 +126,7 @@ {"id":{"name":"c_selectunit","path":"scripts/c_selectunit/c_selectunit.yy",},"order":9,}, {"id":{"name":"array_generate_2d","path":"scripts/array_generate_2d/array_generate_2d.yy",},"order":3,}, {"id":{"name":"c_input","path":"scripts/c_input/c_input.yy",},"order":8,}, + {"id":{"name":"o_damage","path":"objects/o_damage/o_damage.yy",},"order":4,}, {"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,}, diff --git a/eastern flames/objects/ARTICULATOR/Create_0.gml b/eastern flames/objects/ARTICULATOR/Create_0.gml index 2297ae0..c2f12d8 100644 --- a/eastern flames/objects/ARTICULATOR/Create_0.gml +++ b/eastern flames/objects/ARTICULATOR/Create_0.gml @@ -8,6 +8,7 @@ var i; c_loadstageone(); +waiting = 0; selectedunit = noone; hoveredunit = noone; hspd = 0; diff --git a/eastern flames/objects/o_damage/Create_0.gml b/eastern flames/objects/o_damage/Create_0.gml new file mode 100644 index 0000000..b173b8c --- /dev/null +++ b/eastern flames/objects/o_damage/Create_0.gml @@ -0,0 +1,4 @@ +amount = 0; +count = 0; +hspd = 0; +vspd = 0; \ No newline at end of file diff --git a/eastern flames/objects/o_damage/Draw_0.gml b/eastern flames/objects/o_damage/Draw_0.gml new file mode 100644 index 0000000..f207c1b --- /dev/null +++ b/eastern flames/objects/o_damage/Draw_0.gml @@ -0,0 +1,16 @@ +cpp(); +draw_set_color(c_black); +//draw_set_alpha(0.25); +//draw_circle(x,y,5,false); +//draw_set_alpha(1); +var worldMat = matrix_get(matrix_world); +//this is the location of where i want to draw from !!! +var worldMat2 = matrix_build(x,y+6,0,50,0,0,0.6,0.6,0.6); +matrix_set(matrix_world,worldMat2); +draw_set_halign(fa_center); +draw_text(0, 0, amount); +draw_set_halign(fa_left); +//draw_set_color(c_red); +//draw_circle(x, y, 5, false); + +matrix_set(matrix_world,worldMat); \ No newline at end of file diff --git a/eastern flames/objects/o_damage/Step_0.gml b/eastern flames/objects/o_damage/Step_0.gml new file mode 100644 index 0000000..014bc5b --- /dev/null +++ b/eastern flames/objects/o_damage/Step_0.gml @@ -0,0 +1,7 @@ +vspd -= .2; +x += hspd; +y += vspd; +if count >= 40 { + image_alpha -= .1; + if !image_alpha instance_destroy(); +} \ No newline at end of file diff --git a/eastern flames/objects/o_damage/o_damage.yy b/eastern flames/objects/o_damage/o_damage.yy new file mode 100644 index 0000000..c3a523c --- /dev/null +++ b/eastern flames/objects/o_damage/o_damage.yy @@ -0,0 +1,35 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"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":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Objects", + "path": "folders/Objects.yy", + }, + "resourceVersion": "1.0", + "name": "o_damage", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/eastern flames/objects/o_unit/Create_0.gml b/eastern flames/objects/o_unit/Create_0.gml index 4850b51..322b021 100644 --- a/eastern flames/objects/o_unit/Create_0.gml +++ b/eastern flames/objects/o_unit/Create_0.gml @@ -28,11 +28,15 @@ continuecombat = function(me, them) { action = { effect: function(me, them) { + var guy = instance_create(them.x, them.y, o_damage); + guy.hspd = random(3)-1.5; + guy.vspd = -random(1)-3; if irandom(99) < (me.data.hit.val) { //add avo them.data.hp.val -= (me.data.str.val-them.data.def.val); + guy.amount = (me.data.str.val-them.data.def.val); return me.data.str.val; } else { - log(string(me) + " missed!"); + guy.amount = "Miss!"; return 0; } diff --git a/eastern flames/scripts/c_doenemyai/c_doenemyai.gml b/eastern flames/scripts/c_doenemyai/c_doenemyai.gml index b60d06f..26d983d 100644 --- a/eastern flames/scripts/c_doenemyai/c_doenemyai.gml +++ b/eastern flames/scripts/c_doenemyai/c_doenemyai.gml @@ -97,6 +97,7 @@ function c_doenemyai(target) { break; } c_loadmarkings(); + waiting = 70; } function c_findnearestunit(alignment) { diff --git a/eastern flames/scripts/c_moveunit/c_moveunit.gml b/eastern flames/scripts/c_moveunit/c_moveunit.gml index c9d8d8d..5d965e8 100644 --- a/eastern flames/scripts/c_moveunit/c_moveunit.gml +++ b/eastern flames/scripts/c_moveunit/c_moveunit.gml @@ -1,7 +1,7 @@ function c_moveunit(targetunit, destination) { var theguy = c_gettile(targetunit.pos.x, targetunit.pos.y); log(theguy.contents); - if !array_remove(theguy.contents, targetunit) idhfnjg(); + /*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_control/st_control.gml b/eastern flames/scripts/st_control/st_control.gml index e9a50e2..772fe66 100644 --- a/eastern flames/scripts/st_control/st_control.gml +++ b/eastern flames/scripts/st_control/st_control.gml @@ -73,6 +73,7 @@ function st_control() { } c_dewait(global.turn); //global.turn = (global.turn+1)%2; + k = 0; global.turn = ARMY.THEM; log("TURN " + string(global.turn)); state = st_enemyturn; diff --git a/eastern flames/scripts/st_enemyturn/st_enemyturn.gml b/eastern flames/scripts/st_enemyturn/st_enemyturn.gml index 9a765dd..6c36ce0 100644 --- a/eastern flames/scripts/st_enemyturn/st_enemyturn.gml +++ b/eastern flames/scripts/st_enemyturn/st_enemyturn.gml @@ -1,19 +1,36 @@ function st_enemyturn() { - while global.turn == ARMY.THEM { - var done = true; - for (k=0; k= array_length(global.units[ARMY.THEM]){ + done = true; + } + //} + if done { + c_dewait(global.turn); + k = 0; + state = st_control; + global.turn = ARMY.US; + } + //} } \ No newline at end of file diff --git a/eastern flames/scripts/st_standing/st_standing.gml b/eastern flames/scripts/st_standing/st_standing.gml index ffc02f2..3a2c3d1 100644 --- a/eastern flames/scripts/st_standing/st_standing.gml +++ b/eastern flames/scripts/st_standing/st_standing.gml @@ -1,5 +1,5 @@ function st_standing() { - x = pos.x*global.tilesize.x+global.tilesize.x/2; - y = pos.y*global.tilesize.y+global.tilesize.y/2; + x = lerp(x, pos.x*global.tilesize.x+global.tilesize.x/2, .1); + y = lerp(y, pos.y*global.tilesize.y+global.tilesize.y/2, .1); //log(x, y); } \ No newline at end of file