Compare commits
2 Commits
80fa7e40a3
...
641ccd1065
Author | SHA1 | Date |
---|---|---|
the me | 641ccd1065 | |
the me | 4d394955fa |
|
@ -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,},
|
||||
|
@ -63,6 +64,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,},
|
||||
|
|
|
@ -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",},
|
||||
|
|
|
@ -3,7 +3,10 @@ var i;
|
|||
/*for (i=0; i<array_length(global.units[ARMY.US]); i++) {
|
||||
c_inheritunit(2+i, 2, un.chara);
|
||||
}*/
|
||||
var chara = c_inheritunit(2, 2, un.chara);
|
||||
c_addweapon(chara, wp.knife, true);
|
||||
c_inheritunit(3, 2, un.kris);
|
||||
var chara = c_inheritunit(8, 5, un.chara);
|
||||
c_addweapon(chara, wp.knife, false);
|
||||
c_addweapon(chara, wp[$"iron sword"], true);
|
||||
c_inheritunit(10, 5, un.kris);
|
||||
selectedunit = noone;
|
||||
global.gw = 640;
|
||||
global.gh = 360;
|
|
@ -0,0 +1,21 @@
|
|||
if selectedunit != noone {
|
||||
draw_set_color(c_black);
|
||||
draw_rectangle(global.gw, global.gh, global.gw-100, global.gh-(array_length(selectedunit.inventory)-1)*32-16, false);
|
||||
draw_set_color(c_white);
|
||||
var i;
|
||||
draw_set_halign(fa_right);
|
||||
for (i=1; i<array_length(selectedunit.inventory); i++) {
|
||||
draw_text(global.gw-10, global.gh-10-i*20, (selectedunit.equippedweapon == i ? "X " : " ") + selectedunit.inventory[i].name);
|
||||
}
|
||||
draw_set_halign(fa_left);
|
||||
|
||||
var dudes = c_getstats(selectedunit);
|
||||
draw_set_color(c_black);
|
||||
draw_rectangle(0, 0, 100, (array_length(dudes)-1)*32+16, false);
|
||||
draw_set_color(c_white);
|
||||
var i;
|
||||
for (i=0; i<array_length(dudes); i++) {
|
||||
draw_text(10, 10+i*20, dudes[i].name + ": " + string(dudes[i].val));
|
||||
}
|
||||
draw_set_halign(fa_left);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
c_input();
|
||||
if select && selectedunit == noone {
|
||||
if select && selectedunit == noone {
|
||||
var mousex = floor(mouse_x/global.tilesize.x);
|
||||
var mousey = floor(mouse_y/global.tilesize.y);
|
||||
log(mousex, mousey);
|
||||
|
@ -14,4 +14,15 @@ if select && selectedunit == noone {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if select {
|
||||
if mouse_x > 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;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ attacked = 0;
|
|||
inventory = [];
|
||||
c_addweapon(id, wp.nothing);
|
||||
equippedweapon = noone;
|
||||
waiting = false;
|
||||
|
||||
continuecombat = function(me, them) {
|
||||
//if stamina returnable = true stamina-- return true
|
||||
|
@ -23,8 +24,14 @@ continuecombat = function(me, them) {
|
|||
|
||||
action = {
|
||||
effect: function(me, them) {
|
||||
them.data.hp.val -= me.data.str.val;
|
||||
return me.data.str.val;
|
||||
if irandom(99) < (me.data.hit.val) { //add avo
|
||||
them.data.hp.val -= me.data.str.val;
|
||||
return me.data.str.val;
|
||||
} else {
|
||||
log(string(me) + " missed!");
|
||||
return 0;
|
||||
|
||||
}
|
||||
}
|
||||
//animation: new actionanim()
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
if waiting image_blend = c_grey else image_blend = c_white;
|
||||
draw_self();
|
||||
drawstate();
|
||||
//log(data);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
function c_getstats(target) {
|
||||
var dudes = variable_struct_get_names(target.data);
|
||||
var lads = variable_struct_get_names(st);
|
||||
var chaps = [];
|
||||
var i;
|
||||
for (i=0; i<array_length(dudes); i++) {
|
||||
while !array_contains(lads, dudes[i]) || dudes[i] == "hp" {
|
||||
array_delete(dudes, i, 1);
|
||||
if i >= array_length(dudes) break;
|
||||
}
|
||||
if i >= array_length(dudes) break;
|
||||
array_push(chaps, target.data[$dudes[i]]);
|
||||
}
|
||||
return chaps;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "c_getstats",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
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;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "c_moveunit",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
|
@ -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,7 @@ function c_selectunit(unitobject) {
|
|||
}
|
||||
}
|
||||
ARTICULATOR.selectedunit = unitobject;
|
||||
return unitobject;
|
||||
}
|
||||
|
||||
function c_deselectunit(unitobject) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -45,3 +45,5 @@ 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");
|
||||
nu stat("hit", "hit rate", "chance to hit");
|
||||
nu stat("mov", "movement", "distance travelable");
|
|
@ -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<array_length(statmods); i++) {
|
||||
modifiers[$statmods[i].name] = statmods[i];
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ function unit(personaldata_, classdata_, stats_) constructor {
|
|||
global.unitdata[$name] = self;
|
||||
}
|
||||
|
||||
nu unit(mydata, mydata, [st.hp.add(92), st.str.add(20), st.def.add(20), st.spd.add(5)]);
|
||||
nu unit(mydata, mydata, [st.hp.add(92), st.str.add(20), st.def.add(10), st.spd.add(5), st.mov.add(4), st.hit.add(0)]);
|
||||
|
||||
mydata = {
|
||||
name: "kris",
|
||||
|
@ -39,7 +39,7 @@ mydata = {
|
|||
up: s_guy2,
|
||||
down: s_guy2,
|
||||
}
|
||||
nu unit(mydata, mydata, [st.hp.add(92), st.str.add(20), st.def.add(20), st.spd.add(5)]);
|
||||
nu unit(mydata, mydata, [st.hp.add(110), st.str.add(20), st.def.add(10), st.spd.add(5), st.mov.add(6), st.hit.add(0)]);
|
||||
|
||||
function archetypedata() constructor {
|
||||
//PERSONALDATA AND CLASSDATA ARE THE SAME THINGS
|
||||
|
|
|
@ -3,8 +3,8 @@ global.weapons = {};
|
|||
function weapon(name_, description_, type_, statmods=[]) constructor {
|
||||
name = name_;
|
||||
description = description_;
|
||||
modifiers = {};
|
||||
type = WPTYPE.SWORD;
|
||||
modifiers = {};
|
||||
var i;
|
||||
for (i=0; i<array_length(statmods); i++) {
|
||||
modifiers[$statmods[i].name] = statmods[i];
|
||||
|
@ -36,7 +36,8 @@ function c_equipweapon(target, weapon_) {
|
|||
log(target.data.str.val);
|
||||
}
|
||||
nu weapon("nothing", "it's literally nothing", WPTYPE.NULL);
|
||||
nu weapon("knife", "bleed, bleed", WPTYPE.SWORD, [new statmod(st.str, 20, add)]);
|
||||
nu weapon("knife", "bleed, bleed", WPTYPE.SWORD, [new statmod(st.str, 20, add), new statmod(st.hit, 100, add)]);
|
||||
nu weapon("iron sword", "made of a cringe material", WPTYPE.SWORD, [new statmod(st.str, 6, add), new statmod(st.hit, 90, add)]);
|
||||
|
||||
function c_modifierreset(target) {
|
||||
var dudes = variable_struct_get_names(target.data);
|
||||
|
|
Loading…
Reference in New Issue