# HG changeset patch # User unc0rr # Date 1189349608 0 # Node ID f382c41f658afd0d93f8bd65ad162ca6ddd8874a # Parent b2e61fc49e5de99d75a666c9bcdbe6b1578815a5 Start implementing triggers in engine diff -r b2e61fc49e5d -r f382c41f658a hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Sat Sep 08 12:12:23 2007 +0000 +++ b/hedgewars/CCHandlers.inc Sun Sep 09 14:53:28 2007 +0000 @@ -464,3 +464,9 @@ cTagsMask:= map[cTagsMask] end; +procedure chAddTrigger(var s: shortstring); +var t: integer; +begin +val(s, t); +AddTrigger(t) +end; diff -r b2e61fc49e5d -r f382c41f658a hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Sat Sep 08 12:12:23 2007 +0000 +++ b/hedgewars/uConsole.pas Sun Sep 09 14:53:28 2007 +0000 @@ -36,7 +36,7 @@ implementation {$J+} uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, uLand, - uRandom, uAmmos; + uRandom, uAmmos, uTriggers; const cLineWidth: LongInt = 0; cLinesCount = 256; @@ -282,6 +282,7 @@ RegisterVariable('capture' , vtCommand, @chCapture , true ); RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); RegisterVariable('addteam' , vtCommand, @chAddTeam , false); +RegisterVariable('addtrig' , vtCommand, @chAddTrigger , false); RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false); RegisterVariable('map' , vtCommand, @chSetMap , false); RegisterVariable('theme' , vtCommand, @chSetTheme , false); diff -r b2e61fc49e5d -r f382c41f658a hedgewars/uTriggers.pas --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hedgewars/uTriggers.pas Sun Sep 09 14:53:28 2007 +0000 @@ -0,0 +1,52 @@ +(* + * Hedgewars, a worms-like game + * Copyright (c) 2007 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + *) + +unit uTriggers; + +interface +uses SDLh, uConsts; +{$INCLUDE options.inc} + +procedure AddTrigger(id: Longword); +procedure DoTrigger(id: Longword); + +implementation +uses uGears; +type PTrigger = ^TTrigger; + TTrigger = record + id: Longword; + Next: PTrigger; + end; +var TriggerList: PTrigger = nil; + +procedure AddTrigger(id: Longword); +var tmp: PTrigger; +begin +new(tmp); +FillChar(tmp^, sizeof(TGear), 0); + +tmp^.id:= id; +if TriggerList <> nil then tmp^.Next:= TriggerList; +TriggerList:= tmp +end; + +procedure DoTrigger(id: Longword); +begin +end; + +end. \ No newline at end of file