its 6 am
This commit is contained in:
parent
b31b8ba5d7
commit
7fb465c82e
43 changed files with 159 additions and 86 deletions
|
@ -3,7 +3,7 @@ function st_moving() {
|
|||
c_input();
|
||||
hspd = lerp(hspd, (right-left)*.07, .4);
|
||||
vspd = lerp(vspd, (down-up)*.07, .4);
|
||||
if !stop dir = DIR.NONE;
|
||||
dir = DIR.NONE;
|
||||
if left dir = DIR.LEFT;
|
||||
if down dir = DIR.DOWN;
|
||||
if up dir = DIR.UP;
|
||||
|
@ -36,8 +36,8 @@ function st_moving() {
|
|||
/*} else {
|
||||
log("not oob!");*/
|
||||
//}
|
||||
var dude = c_gettile(x+hspd+abs(sprite_width)/4, y+vspd, true);
|
||||
if dude != noone {
|
||||
var dude = c_gettile(x, y, true);
|
||||
/*if dude != noone {
|
||||
var dist = c_tiledist(dude.x, dude.y, returnpos.x, returnpos.y);
|
||||
var friend = c_containsunit(dude.x, dude.y);
|
||||
if dist.x + dist.y <= data.mov.val && dude.passable && (friend == noone || friend == id) {
|
||||
|
@ -58,6 +58,21 @@ function st_moving() {
|
|||
y -= vspd*ts.y;
|
||||
x = linear_approach(x, returnpos.x*ts.x+abs(sprite_width)/4, 1);
|
||||
y = linear_approach(y, returnpos.y*ts.y, 1);
|
||||
}*/
|
||||
if dude != noone && !stop {
|
||||
var dist = c_tiledist(dude.x, dude.y, returnpos.x, returnpos.y);
|
||||
x = clamp(x+hspd*ts.x, max(0, returnpos.x*ts.x-(data.mov.val*ts.x-ts.x/2-dist.y*ts.y)), min(20*ts.x, returnpos.x*ts.x+(data.mov.val*ts.x+ts.x-dist.y*ts.y)));
|
||||
y = clamp(y+vspd*ts.y, max(0, returnpos.y*ts.y-(data.mov.val*ts.y-ts.x/2-dist.x*ts.x)), min(20*ts.y, returnpos.y*ts.y+(data.mov.val*ts.y+ts.y-dist.x*ts.x)));
|
||||
//y = clamp(y+vspd*ts.y, max(0, returnpos.y*ts.y-dist.y*ts.y+dist.x*ts.x), min(14*ts.y, returnpos.y*ts.y+dist.y*ts.y-dist.x*ts.x));
|
||||
log(x, y);
|
||||
dude = c_gettile(x, y, true);
|
||||
if dude != noone {
|
||||
pos.x = dude.x;
|
||||
pos.y = dude.y;
|
||||
}
|
||||
} else if dude == noone {
|
||||
x = linear_approach(x, returnpos.x*ts.x, 2);
|
||||
y = linear_approach(y, returnpos.y*ts.y, 2);
|
||||
}
|
||||
//prevremainingmov = remainingmov;
|
||||
c_decolor_all(c_red);
|
||||
|
@ -134,11 +149,13 @@ function st_moving() {
|
|||
if hitting.contents[i].object_index = o_unit {
|
||||
//log("is unit");
|
||||
//log("found two");
|
||||
if hitting.contents[i].alignment != alignment ^^ !data.str.val {
|
||||
//if hitting.contents[i].alignment != alignment ^^ !data.str.val {
|
||||
if hitting.contents[i].alignment == ARMY.THEM ^^ !data.str.val {
|
||||
c_moveunit(id, c_gettile(pos.x, pos.y));
|
||||
c_generatecombatstack([id, hitting.contents[i]]);
|
||||
waiting = true;
|
||||
c_deselectunit(id);
|
||||
exit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -210,9 +227,9 @@ function st_movingdraw() {
|
|||
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-60, 315, string(data.hit.val)+"%");
|
||||
draw_text(320, 315, "HIT");
|
||||
draw_text(320+60, 315, them.data.hit.val);
|
||||
draw_text(320+60, 315, string(them.data.hit.val)+"%");
|
||||
|
||||
|
||||
draw_set_halign(fa_left);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue