Add example SceneScript

master
Alec Murphy 6 years ago
parent 18a3e97cce
commit c7aae52138

@ -45,6 +45,8 @@ class Scene {
U8 song[512];
};
#include "SceneScripts";
CDC *dc=DCNew(640,480);
Scene *SceneAdd(I64 init_x, I64 t_x, I64 t_y, U8 *loc, U8 *bg_file, Scene *sc_head)
@ -495,9 +497,8 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
so_ctr++;
};
#include "SceneObjects"
#include "SceneTargets"
#include "SceneScripts"
#include "SceneObjects";
#include "SceneTargets";
U8 f_charset[0x7F];
@ -658,7 +659,7 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
{
pop_up=PopUpOk(st_scr_msg+(gs->s_tgt_uid[so_ctr]*SO_MAX_DESC));
gs->s_obj_sid[i_use]=-2;
//SceneScript(st_scr_id[so_ctr]);
SceneScript(st_scr_id[gs->s_tgt_uid[so_ctr]],gs);
}
else {
pop_up=PopUpOk("You can't use that item here.");
@ -1061,7 +1062,7 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
//ACT_USE
if (left_action==ACT_USE && use_tid!=-1)
{

use_obj=TRUE;
if (gs->player_y+st_height[gs->s_tgt_uid[use_tid]]<gs->s_obj_y[use_tid] || gs->player_y+st_height[gs->s_tgt_uid[use_tid]]>(gs->s_obj_y[use_tid]+st_height[gs->s_tgt_uid[use_tid]]))
{
@ -1076,7 +1077,7 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
{
pop_up=PopUpOk(st_scr_msg+(gs->s_tgt_uid[use_tid]*SO_MAX_DESC));
gs->s_obj_sid[i_use]=-2;
//SceneScript(st_scr_id[so_ctr]);
SceneScript(st_scr_id[gs->s_tgt_uid[use_tid]],gs);
}
else {
pop_up=PopUpOk("You can't use that item here.");

@ -1,9 +1,9 @@
// Scene Object Definitions
so_row[1]=0; so_col[1]=1; StrCpy(so_desc+(1*SO_MAX_DESC), "Diet Shasta Bottle");
so_row[1]=0; so_col[1]=1; StrCpy(so_desc+(1*SO_MAX_DESC), "Diet Shasta Bottle");
so_row[2]=0; so_col[2]=2; StrCpy(so_desc+(2*SO_MAX_DESC), "Chef Boyardee");
so_row[3]=0; so_col[3]=3; StrCpy(so_desc+(3*SO_MAX_DESC), "Platinum Kilogram");
so_row[4]=0; so_col[4]=4; StrCpy(so_desc+(4*SO_MAX_DESC), "Gold Key");
so_row[4]=0; so_col[4]=4; StrCpy(so_desc+(4*SO_MAX_DESC), "Gold Key");
so_row[5]=1; so_col[5]=1; StrCpy(so_desc+(5*SO_MAX_DESC), "Plate of Nuggies");
so_row[6]=1; so_col[6]=2; StrCpy(so_desc+(6*SO_MAX_DESC), "Bars of Soap");
so_row[7]=1; so_col[7]=3; StrCpy(so_desc+(7*SO_MAX_DESC), "Intel Xeon E7 CPU");

@ -9,6 +9,21 @@
prior to trigger SceneScript
*/
U0 SceneScript(I64 script, GameState *gs)
{
switch (script)
{
case 0x01:
// Test script placement Scene Object (nuggies)
gs->s_obj_uid[20]=5;
gs->s_obj_sid[20]=0;
gs->s_obj_x[20]=451;
gs->s_obj_y[20]=312;
break;
default:
break;
}

};

@ -3,6 +3,6 @@
st_width[1]=142; st_height[1]=58;
st_charx[1]=0; st_chary[1]=0;
st_so_uid[1]=4; st_scr_id[1]=0;
st_so_uid[1]=4; st_scr_id[1]=1;
StrCpy(st_desc+(1*SO_MAX_DESC), "Garage");
StrCpy(st_scr_msg+(1*SO_MAX_DESC),"You use the Gold Key on the Garage.");
StrCpy(st_scr_msg+(1*SO_MAX_DESC),"You use the Gold Key on the\nGarage, and some nuggies fall\nout of the tree.");

Loading…
Cancel
Save