Allow dis-arming of events. Red-alert soundnow stops once out in corridor.

This commit is contained in:
stevenhowes
2021-09-01 19:47:15 +01:00
parent f210658025
commit 3ff6a534a9
8 changed files with 38 additions and 8 deletions
Binary file not shown.
+2
View File
@@ -676,6 +676,8 @@ void game2_triggerevent(int id)
} }
else if(EventActions[i].Action == 5) // Change overlay tile sprite else if(EventActions[i].Action == 5) // Change overlay tile sprite
fullmap[EventActions[i].ActionTarget + 10000] = EventActions[i].ActionValue; fullmap[EventActions[i].ActionTarget + 10000] = EventActions[i].ActionValue;
else if(EventActions[i].Action == 6) // Dis-arm
Events[EventActions[i].ActionTarget].Triggered = 1;
} }
} }
} }
+22
View File
@@ -142,6 +142,28 @@
$eventactions[] = array("Event"=>$inevent,"Action"=>3,"ActionValue"=>255,"ActionTarget"=>$target); $eventactions[] = array("Event"=>$inevent,"Action"=>3,"ActionValue"=>255,"ActionTarget"=>$target);
} }
break; break;
case "DisArm":
if($inevent < 0)
{
echo " Invalid outside event\n";
}
else
{
$csv = str_getcsv($split[1]);
$target = -1;
foreach($events as $eventid=>$event)
{
if($event['Name'] == $csv[0])
$target = $eventid;
}
if($target < 0)
echo " Unknown target: " . $csv[0] . "\n";
else
$eventactions[] = array("Event"=>$inevent,"Action"=>6,"ActionValue"=>255,"ActionTarget"=>$target);
}
break;
case "Schedule": case "Schedule":
if($inevent < 0) if($inevent < 0)
{ {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+14 -8
View File
@@ -43,20 +43,21 @@ AddEvent(15,"MESS-AREA",0,-1,-1)
########################################### ###########################################
AddEvent(16,"REDALERTON",0,-1,-1) AddEvent(16,"REDALERTON",0,-1,-1)
AddEvent(17,"REDALERTOFF",0,-1,-1) AddEvent(17,"REDALERTOFF",0,-1,-1)
AddEvent(18,"REDALERTSTOP",0,-1,-1)
AddEvent(19,"REDALERTSOUND",0,-1,-1)
# Console animation # Console animation
########################################### ###########################################
AddEvent(18,"CONSOLE1",0,-1,-1) AddEvent(20,"CONSOLE1",0,-1,-1)
AddEvent(19,"CONSOLE2",0,-1,-1) AddEvent(21,"CONSOLE2",0,-1,-1)
# Tractor beam events # Tractor beam events
########################################### ###########################################
AddEvent(20,"TRAC1",0,-1,-1) AddEvent(22,"TRAC1",0,-1,-1)
AddEvent(21,"TRAC2",0,-1,-1) AddEvent(23,"TRAC2",0,-1,-1)
AddEvent(22,"TRACOFF",0,-1,-1) AddEvent(24,"TRACOFF",0,-1,-1)
AddEvent(23,"TRACSOUND",0,-1,-1) AddEvent(25,"TRACSOUND",0,-1,-1)
############################################################################### ###############################################################################
@@ -193,7 +194,7 @@ Event("REDALERTON")
SetOverlayTile(2413,84) SetOverlayTile(2413,84)
SetOverlayTile(3113,84) # Cargo bay two SetOverlayTile(3113,84) # Cargo bay two
SetOverlayTile(3413,84) SetOverlayTile(3413,84)
Sound(PCMSAMPLE_ALERT, PCMCHANNEL_AMBIENT) Schedule("REDALERTSOUND",0)
ReArm("REDALERTON") ReArm("REDALERTON")
Event("REDALERTOFF") Event("REDALERTOFF")
Schedule("REDALERTON",125) Schedule("REDALERTON",125)
@@ -206,6 +207,11 @@ Event("REDALERTOFF")
SetOverlayTile(3113,83) # Cargo bay two SetOverlayTile(3113,83) # Cargo bay two
SetOverlayTile(3413,83) SetOverlayTile(3413,83)
ReArm("REDALERTOFF") ReArm("REDALERTOFF")
Event("REDALERTSOUND")
Sound(PCMSAMPLE_ALERT, PCMCHANNEL_AMBIENT)
ReArm("REDALERTSOUND")
Event("REDALERTSTOP")
DisArm("REDALERTSOUND")
########################################### ###########################################
# Console animations # Console animations