turnstates
This commit is contained in:
parent
1a13781220
commit
cd85677efd
57 changed files with 1813 additions and 104 deletions
92
eastern flames/scripts/c_badpractice/c_badpractice.gml
Normal file
92
eastern flames/scripts/c_badpractice/c_badpractice.gml
Normal file
|
@ -0,0 +1,92 @@
|
|||
function c_badpractice(line) {
|
||||
specialchars += 2;
|
||||
i++;
|
||||
var shitread = {text: line};
|
||||
switch string_char_at(shitread.text, i++) {
|
||||
case "c": //color
|
||||
var myguy = string_copy(shitread.text, i, 9);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
i += 9;
|
||||
specialchars += 9;
|
||||
|
||||
//
|
||||
break;
|
||||
case "s": //speed
|
||||
var myguy = string_copy(shitread.text, i, 3);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
if string_digits(myguy2) != myguy2 {
|
||||
} else {
|
||||
i += 3;
|
||||
specialchars += 3;
|
||||
}
|
||||
break;
|
||||
case "l": //size (large)
|
||||
var myguy = string_copy(shitread.text, i, 3);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
if string_digits(myguy2) != myguy2 {
|
||||
} else {
|
||||
i += 3;
|
||||
specialchars += 3;
|
||||
}
|
||||
break;
|
||||
case "w": //wait
|
||||
i += 4;
|
||||
specialchars += 4;
|
||||
break;
|
||||
case "-": //try to skip
|
||||
case "q": //try to skip
|
||||
break;
|
||||
case "v": //viggle
|
||||
var myguy = string_copy(shitread.text, i, 2);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
if string_digits(myguy) != myguy {
|
||||
} else {
|
||||
i += 2;
|
||||
specialchars += 2;
|
||||
}
|
||||
//
|
||||
break;
|
||||
case "i": //italics
|
||||
var myguy = string_copy(shitread.text, i, 1);
|
||||
if string_digits(myguy) != myguy {
|
||||
} else {
|
||||
i++;
|
||||
specialchars++;
|
||||
}
|
||||
break;
|
||||
case "x": //shake
|
||||
var myguy = string_copy(shitread.text, i, 2);
|
||||
if string_digits(myguy) != myguy {
|
||||
|
||||
} else {
|
||||
|
||||
i += 2;
|
||||
specialchars += 2;
|
||||
}
|
||||
break;
|
||||
case "n": //nod
|
||||
break;
|
||||
case "p": //portrait
|
||||
i += 2;
|
||||
specialchars += 2;
|
||||
break;
|
||||
case "j": //actually doesnt work maybe later
|
||||
i++;
|
||||
specialchars++;
|
||||
break;
|
||||
case "a": //audio (sound effect)
|
||||
break;
|
||||
case "f": //in-text function
|
||||
break;
|
||||
case "|": //neither does this
|
||||
|
||||
break;
|
||||
case "g": //neither does this
|
||||
break;
|
||||
#endregion
|
||||
|
||||
default:
|
||||
shitread.text = c_errorstring();
|
||||
break;
|
||||
}
|
||||
}
|
12
eastern flames/scripts/c_badpractice/c_badpractice.yy
Normal file
12
eastern flames/scripts/c_badpractice/c_badpractice.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "c_badpractice",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
47
eastern flames/scripts/c_charpush/c_charpush.gml
Normal file
47
eastern flames/scripts/c_charpush/c_charpush.gml
Normal file
|
@ -0,0 +1,47 @@
|
|||
function c_charpush(char) {
|
||||
var i;
|
||||
for (i=0; i<array_length(talker); i++) {
|
||||
//log(i);
|
||||
//log(char);
|
||||
//log(talker);
|
||||
if char.name == talker[i].name {
|
||||
if char.position == SPRITEPOS.REPLACE {
|
||||
char.position = talker[i].position;
|
||||
}
|
||||
char.x = talker[i].x;
|
||||
char.y = talker[i].y;
|
||||
char.alpha = talker[i].alpha;
|
||||
array_delete(talker, i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
array_insert(talker, 0, char);
|
||||
}
|
||||
|
||||
function talkchar(spriteindex_=s_null, name_="", position_=SPRITEPOS.HIDDEN) constructor {
|
||||
sprite = global.textguy[?string_lower(name_)].sprite;
|
||||
talksound = global.textguy[?string_lower(name_)].talksound;
|
||||
textspeed = global.textguy[?string_lower(name_)].textspeed;
|
||||
texteffects = global.textguy[?string_lower(name_)].texteffects;
|
||||
namecolor = global.textguy[?string_lower(name_)].namecolor;
|
||||
name = name_;
|
||||
index = spriteindex_;
|
||||
position = position_;
|
||||
x = o_textbox.x+(position-2)*o_textbox.width/5;
|
||||
y = o_textbox.spriteposy;
|
||||
alpha = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*global.textguy[?"drip"] = s_drip;
|
||||
global.textguy[?"spamton g. spamton"] = s_drip;
|
||||
global.textguy[?""] = s_null;
|
||||
global.textguy[?"reimu"] = s_reimu16;
|
||||
global.textguy[?"aunn"] = s_aunn16;
|
||||
global.textguy[?"mike"] = s_mike16;
|
||||
global.textguy[?"yukari"] = s_yukari16;
|
||||
global.textguy[?"reisen"] = s_reisen16;
|
||||
global.textguy[?"yumemi"] = s_yumemi16;
|
||||
global.textguy[?"chiyuri"] = s_chiyuri16;*/
|
||||
|
12
eastern flames/scripts/c_charpush/c_charpush.yy
Normal file
12
eastern flames/scripts/c_charpush/c_charpush.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "c_charpush",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
3
eastern flames/scripts/c_errorstring/c_errorstring.gml
Normal file
3
eastern flames/scripts/c_errorstring/c_errorstring.gml
Normal file
|
@ -0,0 +1,3 @@
|
|||
function c_errorstring() {
|
||||
|
||||
}
|
12
eastern flames/scripts/c_errorstring/c_errorstring.yy
Normal file
12
eastern flames/scripts/c_errorstring/c_errorstring.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "c_errorstring",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
144
eastern flames/scripts/c_txtspecial/c_txtspecial.gml
Normal file
144
eastern flames/scripts/c_txtspecial/c_txtspecial.gml
Normal file
|
@ -0,0 +1,144 @@
|
|||
function c_txtspecial() {
|
||||
specialchars += 2;
|
||||
i++
|
||||
switch string_char_at(msg[talkpos].text, i++) {
|
||||
case "c": //color
|
||||
var myguy = string_copy(msg[talkpos].text, i, 9);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
if string_digits(myguy2) != myguy2 {
|
||||
clr = c_white;
|
||||
} else {
|
||||
clr = make_color_rgb(real(string_copy(myguy, 1, 3)), real(string_copy(myguy, 4, 3)), real(string_copy(myguy, 7, 3)));
|
||||
//log(real(string_copy(myguy, 0, 3)), real(string_copy(myguy, 3, 3)), real(string_copy(myguy, 6, 3)));
|
||||
//clr = make_color_rgb(0, 0, 255);
|
||||
i += 9;
|
||||
specialchars += 9;
|
||||
}
|
||||
|
||||
//
|
||||
break;
|
||||
case "s": //speed
|
||||
var myguy = string_copy(msg[talkpos].text, i, 3);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
if string_digits(myguy2) != myguy2 {
|
||||
talkspeed = talker[0].textspeed;
|
||||
} else {
|
||||
talkspeed = real(myguy);
|
||||
i += 3;
|
||||
specialchars += 3;
|
||||
}
|
||||
break;
|
||||
case "l": //size (large)
|
||||
var myguy = string_copy(msg[talkpos].text, i, 3);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
if string_digits(myguy2) != myguy2 {
|
||||
sizemult = 1;
|
||||
} else {
|
||||
sizemult = real(myguy);
|
||||
i += 3;
|
||||
specialchars += 3;
|
||||
}
|
||||
break;
|
||||
case "w": //wait
|
||||
var myguy = string_copy(msg[talkpos].text, i, 4);
|
||||
i += 4;
|
||||
specialchars += 4;
|
||||
|
||||
if !waited[waiting] {
|
||||
wait = real(myguy);
|
||||
waited[waiting] = true;
|
||||
drawchars--;
|
||||
exit;
|
||||
} else {
|
||||
//wait = 9999;
|
||||
}
|
||||
break;
|
||||
case "-": //try to skip
|
||||
if !skipped {
|
||||
selecting = true;
|
||||
skipped = true;
|
||||
drawchars = talklength;
|
||||
}
|
||||
case "q": //try to skip
|
||||
drawchars = talklength;
|
||||
break;
|
||||
case "v": //viggle
|
||||
var myguy = string_copy(msg[talkpos].text, i, 2);
|
||||
var myguy2 = string_replace(myguy, ".", "0");
|
||||
if string_digits(myguy) != myguy {
|
||||
wigglex = 0;
|
||||
wiggley = 0;
|
||||
} else {
|
||||
wigglex = real(string_copy(myguy, 1, 1));
|
||||
wiggley = real(string_copy(myguy, 2, 1));
|
||||
i += 2;
|
||||
specialchars += 2;
|
||||
}
|
||||
//
|
||||
break;
|
||||
case "i": //italics
|
||||
var myguy = string_copy(msg[talkpos].text, i, 1);
|
||||
if string_digits(myguy) != myguy {
|
||||
draw_set_font(restorefont);
|
||||
} else {
|
||||
i++;
|
||||
specialchars++;
|
||||
restorefont = draw_get_font()
|
||||
draw_set_font(font_get_italic(draw_get_font()));
|
||||
}
|
||||
break;
|
||||
case "x": //shake
|
||||
var myguy = string_copy(msg[talkpos].text, i, 2);
|
||||
if string_digits(myguy) != myguy {
|
||||
shake = 0;
|
||||
} else {
|
||||
shake = real(myguy);
|
||||
i += 2;
|
||||
specialchars += 2;
|
||||
}
|
||||
break;
|
||||
case "n": //nod
|
||||
if select || pressed[pressing] {
|
||||
pressed[pressing] = true;
|
||||
pressing++;
|
||||
wait = 0;
|
||||
} else {
|
||||
wait = 9999;
|
||||
}
|
||||
|
||||
break;
|
||||
case "f": //facepic
|
||||
var myguy = string_copy(msg[talkpos].text, i, 2);
|
||||
talkindex[spritepos] = real(myguy);
|
||||
i += 2;
|
||||
specialchars += 2;
|
||||
break;
|
||||
|
||||
|
||||
#region bustedones
|
||||
case "j": //actually doesnt work maybe later
|
||||
var myguy = string_copy(msg[talkpos].text, i, 1);
|
||||
switch myguy {
|
||||
case "c":
|
||||
draw_set_halign(fa_center);
|
||||
break;
|
||||
case "r":
|
||||
draw_set_halign(fa_right);
|
||||
break;
|
||||
default:
|
||||
draw_set_halign(fa_left);
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
specialchars++;
|
||||
break;
|
||||
case "|": //neither does this
|
||||
|
||||
break;
|
||||
#endregion
|
||||
|
||||
default:
|
||||
msg[talkpos].text = c_errorstring();
|
||||
break;
|
||||
}
|
||||
}
|
12
eastern flames/scripts/c_txtspecial/c_txtspecial.yy
Normal file
12
eastern flames/scripts/c_txtspecial/c_txtspecial.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "c_txtspecial",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
16
eastern flames/scripts/chardata/chardata.gml
Normal file
16
eastern flames/scripts/chardata/chardata.gml
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
function chardata(name_="drip", sprite_=s_drip, talksound_=se_null, textspeed_=.5, namecolor_=c_white, texteffects_=[]) constructor {
|
||||
name = name_;
|
||||
sprite = sprite_;
|
||||
talksound = talksound_;
|
||||
textspeed = textspeed_;
|
||||
namecolor = namecolor_;
|
||||
texteffects = texteffects_;
|
||||
|
||||
global.textguy[?string_lower(name)] = self;
|
||||
}
|
||||
function talksprite(name_, char_, val_) constructor {
|
||||
val = val_;
|
||||
variable_struct_set(global.textguy[?char_], name_, self);
|
||||
char = global.textguy[?char_];
|
||||
}
|
12
eastern flames/scripts/chardata/chardata.yy
Normal file
12
eastern flames/scripts/chardata/chardata.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "chardata",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
27
eastern flames/scripts/lb_auto/lb_auto.gml
Normal file
27
eastern flames/scripts/lb_auto/lb_auto.gml
Normal file
|
@ -0,0 +1,27 @@
|
|||
function lb_auto(str, maxlength) {
|
||||
var possible = true;
|
||||
var j;
|
||||
var lbcount = 0;
|
||||
var specialchars = 0;
|
||||
for (i=0; i<string_length(str); i++) {
|
||||
while string_char_at(str, i) = "|" {
|
||||
c_badpractice(str);
|
||||
}
|
||||
if string_char_at(str, i) == "#" lbcount = 0;
|
||||
//if string_char_at(str, i) == "|" lbcount -= 2;
|
||||
if lbcount >= maxlength {
|
||||
for (j=0; j<lbcount; j++) {
|
||||
if string_char_at(str, i-j) == " " && lbcount-j < maxlength {
|
||||
str = string_insert("#", str, i-j);
|
||||
str = string_delete(str, i-j+1, 1);
|
||||
possible = true;
|
||||
break;
|
||||
}
|
||||
possible = false;
|
||||
}
|
||||
lbcount = j;
|
||||
}
|
||||
lbcount++;
|
||||
}
|
||||
return str;
|
||||
}
|
12
eastern flames/scripts/lb_auto/lb_auto.yy
Normal file
12
eastern flames/scripts/lb_auto/lb_auto.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "lb_auto",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
|
@ -1,21 +1,21 @@
|
|||
function msglang(english, japanese=[txt()], language=global.lang) {
|
||||
return array_insert_array_parse(argument[language-1]);
|
||||
/*switch language {
|
||||
function msglang(english, japanese, language=global.lang) {
|
||||
switch language {
|
||||
case LANGUAGE.ENGLISH:
|
||||
return array_insert_array_parse(english);
|
||||
return english;
|
||||
break;
|
||||
case LANGUAGE.JAPANESE:
|
||||
return array_insert_array_parse(japanese);
|
||||
return japanese;
|
||||
break;
|
||||
default:
|
||||
return [txt()];
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum LANGUAGE {
|
||||
NULL,
|
||||
ENGLISH,
|
||||
JAPANESE,
|
||||
}
|
||||
}
|
||||
|
||||
global.lang = LANGUAGE.ENGLISH;
|
|
@ -2,8 +2,8 @@
|
|||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "data",
|
||||
"path": "folders/Scripts/util/data.yy",
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "msglang",
|
||||
|
|
73
eastern flames/scripts/st_control/st_control.gml
Normal file
73
eastern flames/scripts/st_control/st_control.gml
Normal file
|
@ -0,0 +1,73 @@
|
|||
function st_control() {
|
||||
c_input();
|
||||
var mouse = c_2dto3d(mouse_x,mouse_y);
|
||||
if select && selectedunit == noone {
|
||||
var mousex = floor(mouse.x/global.tilesize.x);
|
||||
var mousey = floor(mouse.y/global.tilesize.y);
|
||||
log(mousex, mousey);
|
||||
if mousex < array_length(global.map) && mousex >= 0 {
|
||||
if mousey < array_length(global.map[mousex]) && mousey >= 0 {
|
||||
var i;
|
||||
for (i=0; i<array_length(global.map[mousex][mousey].contents); i++) {
|
||||
if global.map[mousex][mousey].contents[i].object_index == o_unit {
|
||||
var dude = global.map[mousex][mousey].contents[i];
|
||||
if dude.alignment == global.turn {
|
||||
c_selectunit(dude);
|
||||
} else {
|
||||
c_markunit(dude);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
if selectedunit == noone {
|
||||
hspd = lerp(hspd, (right-left)*((.1+stop*.1)*(ts.x)), .4);
|
||||
vspd = lerp(vspd, (down-up)*((.1+stop*.1)*(ts.y)), .4);
|
||||
x += hspd;
|
||||
y += vspd;
|
||||
|
||||
} else {
|
||||
hspd = 0;
|
||||
vspd = 0;
|
||||
x = lerp(x, selectedunit.x, .4);
|
||||
y = lerp(y, selectedunit.y, .4);
|
||||
}
|
||||
|
||||
global.camerax = x;
|
||||
global.cameray = y;
|
||||
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) && mousex >= 0 {
|
||||
if mousey < array_length(global.map[mousex]) && mousey >= 0 {
|
||||
var i;
|
||||
for (i=0; i<array_length(global.map[mousex][mousey].contents); i++) {
|
||||
if global.map[mousex][mousey].contents[i].object_index == o_unit {
|
||||
hoveredunit = (global.map[mousex][mousey].contents[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var i;
|
||||
for (i=0; i<array_length(global.units[global.turn]); i++) {
|
||||
if global.units[global.turn][i].waiting = false exit;
|
||||
}
|
||||
c_dewait(global.turn);
|
||||
global.turn = (global.turn+1)%2;
|
||||
log("TURN " + string(global.turn));
|
||||
state = st_enemyturn;
|
||||
}
|
12
eastern flames/scripts/st_control/st_control.yy
Normal file
12
eastern flames/scripts/st_control/st_control.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "st_control",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
19
eastern flames/scripts/st_enemyturn/st_enemyturn.gml
Normal file
19
eastern flames/scripts/st_enemyturn/st_enemyturn.gml
Normal file
|
@ -0,0 +1,19 @@
|
|||
function st_enemyturn() {
|
||||
while global.turn == ARMY.THEM {
|
||||
var done = true;
|
||||
for (k=0; k<array_length(global.units[ARMY.THEM]); k++) {
|
||||
var target = global.units[ARMY.THEM][k];
|
||||
if !target.waiting {
|
||||
done = false;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
c_doenemyai(target);
|
||||
}
|
||||
if done {
|
||||
c_dewait(global.turn);
|
||||
state = st_control;
|
||||
global.turn = (global.turn+1)%2;
|
||||
}
|
||||
}
|
||||
}
|
12
eastern flames/scripts/st_enemyturn/st_enemyturn.yy
Normal file
12
eastern flames/scripts/st_enemyturn/st_enemyturn.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "st_enemyturn",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
69
eastern flames/scripts/st_textadv/st_textadv.gml
Normal file
69
eastern flames/scripts/st_textadv/st_textadv.gml
Normal file
|
@ -0,0 +1,69 @@
|
|||
global.thecolor = 0xFFFFFF
|
||||
|
||||
function st_textadv() {
|
||||
//surface_set_target(global.surfaces.HUD);
|
||||
draw_sprite(bg, 0, 0, 0);
|
||||
for (i=array_length(talker)-1; i>=0; i--) {
|
||||
draw_sprite_ext(talker[i].sprite,
|
||||
talker[i].index,
|
||||
talker[i].x,
|
||||
talker[i].y,
|
||||
ineg(talker[i].position > SPRITEPOS.CENTER),
|
||||
1, 0, make_color_hsv(0, 0, 255-(i>0)*100), talker[i].alpha*(talker[i].position <= SPRITEPOS.RIGHT));
|
||||
}
|
||||
if halting { exit}
|
||||
draw_sprite(sprite_index, 0, x, y);
|
||||
draw_set_font(font);
|
||||
clr = c_white;
|
||||
var xpos = 0;
|
||||
var lb = 0;
|
||||
sizemult = 1;
|
||||
var effchars = drawchars;
|
||||
specialchars = 0;
|
||||
wigglex = 0;
|
||||
wiggley = 0;
|
||||
shake = 0;
|
||||
sizepos = 0;
|
||||
pressing = 0;
|
||||
fontsize = font_get_size(draw_get_font())*.8;
|
||||
atsound = 0;
|
||||
atfunc = 0;
|
||||
j = 0;
|
||||
if msg[talkpos].type == "normal" {
|
||||
draw_set_color(talker[0].namecolor);
|
||||
draw_set_halign(fa_center);
|
||||
draw_text(x+width/20-width/2+17, y-18, talker[0].name);
|
||||
draw_set_halign(fa_left);
|
||||
draw_set_color(c_white);
|
||||
}
|
||||
draw_set_halign(fa_left);
|
||||
atsound = 0;
|
||||
atfunc = 0;
|
||||
for (i=1; i<=effchars; i++) {
|
||||
while string_char_at(msg[talkpos].text, i) = "|" {
|
||||
c_txtspecial();
|
||||
}
|
||||
effchars = drawchars+specialchars;
|
||||
var centerOffset = 0;
|
||||
if(draw_get_halign() == fa_center || draw_get_halign() == fa_right) {
|
||||
var linelist = string_split(msg[talkpos].text,"#");
|
||||
var msglen = string_length(linelist[lb])
|
||||
centeroffset = ((width/(fontsize+5))) - msglen;
|
||||
if(draw_get_halign() == fa_center) {
|
||||
centeroffset/=2;
|
||||
}
|
||||
}
|
||||
var textoffsetx = cos((count+i*2)/(talkspeed*20))*wigglex+random(shake/2)-shake/4;
|
||||
var textoffsety = sin((count+i*2)/(talkspeed*20))*wiggley+random(shake/2)-shake/4;
|
||||
var textxpos = x+margin+(xpos+centerOffset)*(fontsize)-width/2;
|
||||
var textypos = y+(fontsize)+(lb+nvlline)*(fontsize*2);
|
||||
var thechar = string_hash_to_newline(string_char_at(msg[talkpos].text, i));
|
||||
draw_text_ext_transformed_colour(textxpos+textoffsetx, textypos+textoffsety, thechar, 0, 999, sizemult, sizemult, 0, clr, clr, clr, clr, 1);
|
||||
if string_char_at(msg[talkpos].text, i) = "#" {
|
||||
lb++;
|
||||
xpos = -1;
|
||||
}
|
||||
xpos += sizemult;
|
||||
}
|
||||
}
|
||||
|
12
eastern flames/scripts/st_textadv/st_textadv.yy
Normal file
12
eastern flames/scripts/st_textadv/st_textadv.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "st_textadv",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
120
eastern flames/scripts/st_textnvl/st_textnvl.gml
Normal file
120
eastern flames/scripts/st_textnvl/st_textnvl.gml
Normal file
|
@ -0,0 +1,120 @@
|
|||
function st_textnvl() {
|
||||
//surface_set_target(global.surfaces.HUD);
|
||||
draw_sprite(bg, 0, 0, 0);
|
||||
for (i=array_length(talker)-1; i>=0; i--) {
|
||||
draw_sprite_ext(talker[i].sprite,
|
||||
talker[i].index,
|
||||
talker[i].x,
|
||||
talker[i].y,
|
||||
ineg(talker[i].position > SPRITEPOS.CENTER),
|
||||
1, 0, make_color_hsv(0, 0, 255-(i>0)*100), talker[i].alpha*(talker[i].position <= SPRITEPOS.RIGHT));
|
||||
}
|
||||
if halting { exit}
|
||||
|
||||
draw_sprite(sprite_index, 0, x, y);
|
||||
draw_set_font(font);
|
||||
clr = c_white;
|
||||
var xpos = 0;
|
||||
var lb = 0;
|
||||
sizemult = 1;
|
||||
var effchars = drawchars;
|
||||
specialchars = 0;
|
||||
wigglex = 0;
|
||||
wiggley = 0;
|
||||
shake = 0;
|
||||
sizepos = 0;
|
||||
pressing = 0;
|
||||
fontsize = font_get_size(draw_get_font())*.8;
|
||||
backlogging = true;
|
||||
atsound = 0;
|
||||
atfunc = 0;
|
||||
j = 0;
|
||||
for (j=0; j<array_length(backlog); j++) {
|
||||
if backlog[j].type == "normal" {
|
||||
draw_set_color(backlog[j].guy.namecolor);
|
||||
draw_set_halign(fa_right);
|
||||
draw_text(x-width/2-40, y+(fontsize)+(lb+nvlline)*(fontsize*2), backlog[j].name);
|
||||
draw_set_halign(fa_left);
|
||||
draw_set_color(c_white);
|
||||
}
|
||||
draw_set_halign(fa_left);
|
||||
for (i=1; i<=string_length(backlog[j].text)+1; i++) {
|
||||
while string_char_at(backlog[j].text, i) = "|" {
|
||||
c_txtspecial();
|
||||
}
|
||||
effchars = drawchars+specialchars;
|
||||
var centerOffset = 0;
|
||||
if(draw_get_halign() == fa_center || draw_get_halign() == fa_right) {
|
||||
var linelist = string_split(backlog[j].text,"#");
|
||||
var msglen = string_length(linelist[lb])
|
||||
centeroffset = ((width/(fontsize+5))) - msglen;
|
||||
if(draw_get_halign() == fa_center) {
|
||||
centeroffset/=2;
|
||||
}
|
||||
}
|
||||
var textoffsetx = cos((count+i*2)/(talkspeed*20))*wigglex+random(shake/2)-shake/4;
|
||||
var textoffsety = sin((count+i*2)/(talkspeed*20))*wiggley+random(shake/2)-shake/4;
|
||||
var textxpos = x+margin+(xpos+centerOffset)*(fontsize)-width/2;
|
||||
var textypos = y+(fontsize)+(lb+nvlline)*(fontsize*2);
|
||||
var thechar = string_hash_to_newline(string_char_at(backlog[j].text, i));
|
||||
draw_text_ext_transformed_colour(textxpos+textoffsetx, textypos+textoffsety, thechar, 0, 999, sizemult, sizemult, 0, clr, clr, clr, clr, 1);
|
||||
if string_char_at(backlog[j].text, i) = "#" {
|
||||
lb++;
|
||||
xpos = -1;
|
||||
}
|
||||
xpos += sizemult;
|
||||
}
|
||||
draw_set_font(font);
|
||||
lb++;
|
||||
clr = c_white;
|
||||
var clrdur = 0;
|
||||
var xpos = 0;
|
||||
sizemult = 1;
|
||||
var effchars = drawchars;
|
||||
specialchars = 0;
|
||||
wigglex = 0;
|
||||
wiggley = 0;
|
||||
shake = 0;
|
||||
sizepos = 0;
|
||||
pressing = 0;
|
||||
fontsize = font_get_size(draw_get_font())*.8;
|
||||
atsound = 0;
|
||||
atfunc = 0;
|
||||
}
|
||||
backlogging = false;
|
||||
if msg[talkpos].type == "normal" {
|
||||
draw_set_color(msg[talkpos].guy.namecolor);
|
||||
draw_set_halign(fa_right);
|
||||
draw_text(x-width/2-40, y+(fontsize)+(lb+nvlline)*(fontsize*2), msg[talkpos].name);
|
||||
draw_set_halign(fa_left);
|
||||
draw_set_color(c_white);
|
||||
}
|
||||
atsound = 0;
|
||||
atfunc = 0;
|
||||
for (i=1; i<=effchars; i++) {
|
||||
while string_char_at(msg[talkpos].text, i) = "|" {
|
||||
c_txtspecial();
|
||||
}
|
||||
effchars = drawchars+specialchars;
|
||||
var centerOffset = 0;
|
||||
if(draw_get_halign() == fa_center || draw_get_halign() == fa_right) {
|
||||
var linelist = string_split(msg[talkpos].text,"#");
|
||||
var msglen = string_length(linelist[lb]);
|
||||
centeroffset = ((width/(fontsize+5))) - msglen;
|
||||
if(draw_get_halign() == fa_center) {
|
||||
centeroffset/=2;
|
||||
}
|
||||
}
|
||||
var textoffsetx = cos((count+i*2)/(talkspeed*20))*wigglex+random(shake/2)-shake/4;
|
||||
var textoffsety = sin((count+i*2)/(talkspeed*20))*wiggley+random(shake/2)-shake/4;
|
||||
var textxpos = x+margin+(xpos+centerOffset)*(fontsize)-width/2;
|
||||
var textypos = y+(fontsize)+(lb+nvlline)*(fontsize*2);
|
||||
var thechar = string_hash_to_newline(string_char_at(msg[talkpos].text, i));
|
||||
draw_text_ext_transformed_colour(textxpos+textoffsetx, textypos+textoffsety, thechar, 0, 999, sizemult, sizemult, 0, clr, clr, clr, clr, 1);
|
||||
if string_char_at(msg[talkpos].text, i) = "#" {
|
||||
lb++;
|
||||
xpos = -1;
|
||||
}
|
||||
xpos += sizemult;
|
||||
}
|
||||
}
|
12
eastern flames/scripts/st_textnvl/st_textnvl.yy
Normal file
12
eastern flames/scripts/st_textnvl/st_textnvl.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "st_textnvl",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
15
eastern flames/scripts/textbox_create/textbox_create.gml
Normal file
15
eastern flames/scripts/textbox_create/textbox_create.gml
Normal file
|
@ -0,0 +1,15 @@
|
|||
function textbox_create(textscript=txt_test, style=global.textdefault, advancable=true) {
|
||||
instance_destroy(o_textbox);
|
||||
var chump = instance_create(style.x, style.y, o_textbox);
|
||||
chump.width = style.width;
|
||||
chump.height = style.height;
|
||||
chump.spriteposx = style.spriteposx;
|
||||
chump.spriteposy = style.spriteposy;
|
||||
chump.advance = advancable;
|
||||
chump.msgscript = textscript;
|
||||
chump.sprite_index = style.sprite;
|
||||
chump.texttype = style.type;
|
||||
chump.font = style.font;
|
||||
chump.style = style;
|
||||
return chump;
|
||||
}
|
12
eastern flames/scripts/textbox_create/textbox_create.yy
Normal file
12
eastern flames/scripts/textbox_create/textbox_create.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "textbox_create",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
36
eastern flames/scripts/textline_next/textline_next.gml
Normal file
36
eastern flames/scripts/textline_next/textline_next.gml
Normal file
|
@ -0,0 +1,36 @@
|
|||
function textline_next() {
|
||||
do {
|
||||
draw_set_font(font);
|
||||
skipped = false;
|
||||
waiting = 0;
|
||||
waited = array_create(20);
|
||||
pressing = 0;
|
||||
pressed = array_create(20);
|
||||
if txtprocessed {
|
||||
if msg[talkpos].type == "normal" {
|
||||
array_push(backlog, msg[talkpos]);
|
||||
}
|
||||
talkpos++;
|
||||
if msg[talkpos].type == "ptxt" {
|
||||
backlog = [];
|
||||
}
|
||||
}
|
||||
var dudes = font_get_size(draw_get_font())*.8;
|
||||
var dudes2 = floor((width-margin*2)/dudes);
|
||||
//log(dudes2);
|
||||
msg[talkpos].text = lb_auto(msg[talkpos].text, dudes2);
|
||||
//log(msg[talkpos]);
|
||||
talklength = string_length(msg[talkpos].text);
|
||||
drawing = "";
|
||||
drawchars = 0;
|
||||
name = msg[talkpos].name;
|
||||
msg[talkpos].event();
|
||||
c_charpush(new talkchar(msg[talkpos].sprite, msg[talkpos].name, msg[talkpos].spritepos));
|
||||
talkspeed = talker[0].textspeed;
|
||||
if msg[talkpos].bg != "UNCHANGED" bg = msg[talkpos].bg;
|
||||
didsounds = array_create(999);
|
||||
didfuncs = array_create(999);
|
||||
atsound = 0;
|
||||
atfunc = 0;
|
||||
} until msg[talkpos].type == "normal" || (string_contains(msg[talkpos].text, "|w") && !string_contains(msg[talkpos].text, "|w0000"));
|
||||
}
|
12
eastern flames/scripts/textline_next/textline_next.yy
Normal file
12
eastern flames/scripts/textline_next/textline_next.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "textline_next",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
48
eastern flames/scripts/txt/txt.gml
Normal file
48
eastern flames/scripts/txt/txt.gml
Normal file
|
@ -0,0 +1,48 @@
|
|||
function txt(text_=c_errorstring(), sprite_=global.textguy[?""].NOTHING, spritepos_=SPRITEPOS.REPLACE, bg_="UNCHANGED", event_=c_null, sounds_=[], funcs_=[]) {
|
||||
return {
|
||||
text: text_,
|
||||
name: sprite_.char.name,
|
||||
sprite: sprite_.val,
|
||||
guy: sprite_.char,
|
||||
event: event_,
|
||||
spritepos: spritepos_,
|
||||
bg: bg_,
|
||||
sounds: sounds_,
|
||||
funcs: funcs_,
|
||||
type:"normal",
|
||||
};
|
||||
}//not technically a constructor since dont wanna write new every time
|
||||
|
||||
function ntxt(wait=0, sprite_=global.textguy[?""].NOTHING, spritepos_=SPRITEPOS.HIDDEN, bg_="UNCHANGED", event_=c_null) {
|
||||
return {
|
||||
text: "|w"+ string_format(wait, 4, 0) + "|-",
|
||||
name: sprite_.char.name,
|
||||
sprite: sprite_.val,
|
||||
event: event_,
|
||||
spritepos: spritepos_,
|
||||
bg: bg_,
|
||||
type: "ntxt",
|
||||
};
|
||||
}
|
||||
|
||||
function ptxt(wait=0, sprite_=global.textguy[?""].NOTHING, spritepos_=SPRITEPOS.HIDDEN, bg_="UNCHANGED", event_=c_null) {
|
||||
return {
|
||||
text: "",
|
||||
name: sprite_.char.name,
|
||||
sprite: sprite_.val,
|
||||
event: event_,
|
||||
spritepos: spritepos_,
|
||||
bg: bg_,
|
||||
type: "ptxt",
|
||||
};
|
||||
}
|
||||
|
||||
enum SPRITEPOS {
|
||||
LEFT,
|
||||
MIDLEFT,
|
||||
CENTER,
|
||||
MIDRIGHT,
|
||||
RIGHT,
|
||||
HIDDEN,
|
||||
REPLACE,
|
||||
}
|
12
eastern flames/scripts/txt/txt.yy
Normal file
12
eastern flames/scripts/txt/txt.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "txt",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
14
eastern flames/scripts/txt_/txt_.gml
Normal file
14
eastern flames/scripts/txt_/txt_.gml
Normal file
|
@ -0,0 +1,14 @@
|
|||
function txt_() {
|
||||
|
||||
msg = msglang([
|
||||
|
||||
txt(""),
|
||||
|
||||
],[
|
||||
|
||||
txt(""),
|
||||
|
||||
])
|
||||
|
||||
endevent = c_null;
|
||||
}
|
12
eastern flames/scripts/txt_/txt_.yy
Normal file
12
eastern flames/scripts/txt_/txt_.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "txt_",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
eastern flames/scripts/txt_test/txt_.yy
Normal file
12
eastern flames/scripts/txt_test/txt_.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "txt_",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
14
eastern flames/scripts/txt_test/txt_test.gml
Normal file
14
eastern flames/scripts/txt_test/txt_test.gml
Normal file
|
@ -0,0 +1,14 @@
|
|||
function txt_test() {
|
||||
ARTICULATOR.state = c_null;
|
||||
msg = msglang([
|
||||
|
||||
txt("hi guys"),
|
||||
|
||||
],[
|
||||
|
||||
txt(""),
|
||||
|
||||
])
|
||||
|
||||
endevent = function() {ARTICULATOR.state = st_control};
|
||||
}
|
12
eastern flames/scripts/txt_test/txt_test.yy
Normal file
12
eastern flames/scripts/txt_test/txt_test.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Scripts",
|
||||
"path": "folders/Scripts.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "txt_test",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
18
eastern flames/scripts/x_charsetup/x_charsetup.gml
Normal file
18
eastern flames/scripts/x_charsetup/x_charsetup.gml
Normal file
|
@ -0,0 +1,18 @@
|
|||
global.textguy = ds_map_create();
|
||||
nu chardata("", s_null, se_null, 1);
|
||||
nu talksprite("NOTHING", "", 0);
|
||||
|
||||
|
||||
|
||||
|
||||
//chardata template
|
||||
nu chardata("Terry Davis", s_null, se_null, .5);
|
||||
var z=0;
|
||||
nu talksprite("EXPRESSION1", "terry davis", z++);
|
||||
nu talksprite("EXPRESSION2", "terry davis", z++);
|
||||
nu talksprite("ETC", "terry davis", z++);
|
||||
#macro REISEN global.textguy[?"terry davis"]
|
||||
|
||||
|
||||
|
||||
|
12
eastern flames/scripts/x_charsetup/x_charsetup.yy
Normal file
12
eastern flames/scripts/x_charsetup/x_charsetup.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "x_charsetup",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
24
eastern flames/scripts/x_textstyles/x_textstyles.gml
Normal file
24
eastern flames/scripts/x_textstyles/x_textstyles.gml
Normal file
|
@ -0,0 +1,24 @@
|
|||
global.gw = 290;
|
||||
global.gh = 340;//uh oh
|
||||
|
||||
enum TEXTTYPE {
|
||||
ADV,
|
||||
NVL,
|
||||
FREE,
|
||||
OUTLINE,
|
||||
COURT,
|
||||
}
|
||||
|
||||
global.textdefault = {
|
||||
x: 320,
|
||||
y: 200,
|
||||
width: 640,
|
||||
height: 100,
|
||||
spriteposx: 210,
|
||||
spriteposy: 190,
|
||||
sprite: s_spacetext,
|
||||
type: TEXTTYPE.ADV,
|
||||
font: ft_couriernew,
|
||||
}
|
||||
|
||||
|
12
eastern flames/scripts/x_textstyles/x_textstyles.yy
Normal file
12
eastern flames/scripts/x_textstyles/x_textstyles.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "Textbox",
|
||||
"path": "folders/Textbox.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "x_textstyles",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue