p_spec.h 21 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. /* Emacs style mode select -*- C++ -*-
  2. *-----------------------------------------------------------------------------
  3. *
  4. *
  5. * PrBoom: a Doom port merged with LxDoom and LSDLDoom
  6. * based on BOOM, a modified and improved DOOM engine
  7. * Copyright (C) 1999 by
  8. * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
  9. * Copyright (C) 1999-2000 by
  10. * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
  11. * Copyright 2005, 2006 by
  12. * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version 2
  17. * of the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  27. * 02111-1307, USA.
  28. *
  29. * DESCRIPTION: definitions, declarations and prototypes for specials
  30. *
  31. *-----------------------------------------------------------------------------*/
  32. #ifndef __P_SPEC__
  33. #define __P_SPEC__
  34. #include "r_defs.h"
  35. #include "d_player.h"
  36. // Define values for map objects
  37. #define MO_TELEPORTMAN 14
  38. // p_floor
  39. #define ELEVATORSPEED (FRACUNIT*4)
  40. #define FLOORSPEED FRACUNIT
  41. // p_ceilng
  42. #define CEILSPEED FRACUNIT
  43. #define CEILWAIT 150
  44. // p_doors
  45. #define VDOORSPEED (FRACUNIT*2)
  46. #define VDOORWAIT 150
  47. // p_plats
  48. #define PLATWAIT 3
  49. #define PLATSPEED FRACUNIT
  50. // p_switch
  51. // 4 players, 4 buttons each at once, max.
  52. // killough 2/14/98: redefine in terms of MAXPLAYERS
  53. #define MAXBUTTONS (MAXPLAYERS*4)
  54. // 1 second, in ticks.
  55. #define BUTTONTIME TICRATE
  56. // p_lights
  57. #define GLOWSPEED 8
  58. #define STROBEBRIGHT 5
  59. #define FASTDARK 15
  60. #define SLOWDARK 35
  61. //jff 3/14/98 add bits and shifts for generalized sector types
  62. #define DAMAGE_MASK 0x60
  63. #define DAMAGE_SHIFT 5
  64. #define SECRET_MASK 0x80
  65. #define SECRET_SHIFT 7
  66. #define FRICTION_MASK 0x100
  67. #define FRICTION_SHIFT 8
  68. #define PUSH_MASK 0x200
  69. #define PUSH_SHIFT 9
  70. //jff 02/04/98 Define masks, shifts, for fields in
  71. // generalized linedef types
  72. #define GenEnd 0x8000
  73. #define GenFloorBase 0x6000
  74. #define GenCeilingBase 0x4000
  75. #define GenDoorBase 0x3c00
  76. #define GenLockedBase 0x3800
  77. #define GenLiftBase 0x3400
  78. #define GenStairsBase 0x3000
  79. #define GenCrusherBase 0x2F80
  80. #define TriggerType 0x0007
  81. #define TriggerTypeShift 0
  82. // define masks and shifts for the floor type fields
  83. #define FloorCrush 0x1000
  84. #define FloorChange 0x0c00
  85. #define FloorTarget 0x0380
  86. #define FloorDirection 0x0040
  87. #define FloorModel 0x0020
  88. #define FloorSpeed 0x0018
  89. #define FloorCrushShift 12
  90. #define FloorChangeShift 10
  91. #define FloorTargetShift 7
  92. #define FloorDirectionShift 6
  93. #define FloorModelShift 5
  94. #define FloorSpeedShift 3
  95. // define masks and shifts for the ceiling type fields
  96. #define CeilingCrush 0x1000
  97. #define CeilingChange 0x0c00
  98. #define CeilingTarget 0x0380
  99. #define CeilingDirection 0x0040
  100. #define CeilingModel 0x0020
  101. #define CeilingSpeed 0x0018
  102. #define CeilingCrushShift 12
  103. #define CeilingChangeShift 10
  104. #define CeilingTargetShift 7
  105. #define CeilingDirectionShift 6
  106. #define CeilingModelShift 5
  107. #define CeilingSpeedShift 3
  108. // define masks and shifts for the lift type fields
  109. #define LiftTarget 0x0300
  110. #define LiftDelay 0x00c0
  111. #define LiftMonster 0x0020
  112. #define LiftSpeed 0x0018
  113. #define LiftTargetShift 8
  114. #define LiftDelayShift 6
  115. #define LiftMonsterShift 5
  116. #define LiftSpeedShift 3
  117. // define masks and shifts for the stairs type fields
  118. #define StairIgnore 0x0200
  119. #define StairDirection 0x0100
  120. #define StairStep 0x00c0
  121. #define StairMonster 0x0020
  122. #define StairSpeed 0x0018
  123. #define StairIgnoreShift 9
  124. #define StairDirectionShift 8
  125. #define StairStepShift 6
  126. #define StairMonsterShift 5
  127. #define StairSpeedShift 3
  128. // define masks and shifts for the crusher type fields
  129. #define CrusherSilent 0x0040
  130. #define CrusherMonster 0x0020
  131. #define CrusherSpeed 0x0018
  132. #define CrusherSilentShift 6
  133. #define CrusherMonsterShift 5
  134. #define CrusherSpeedShift 3
  135. // define masks and shifts for the door type fields
  136. #define DoorDelay 0x0300
  137. #define DoorMonster 0x0080
  138. #define DoorKind 0x0060
  139. #define DoorSpeed 0x0018
  140. #define DoorDelayShift 8
  141. #define DoorMonsterShift 7
  142. #define DoorKindShift 5
  143. #define DoorSpeedShift 3
  144. // define masks and shifts for the locked door type fields
  145. #define LockedNKeys 0x0200
  146. #define LockedKey 0x01c0
  147. #define LockedKind 0x0020
  148. #define LockedSpeed 0x0018
  149. #define LockedNKeysShift 9
  150. #define LockedKeyShift 6
  151. #define LockedKindShift 5
  152. #define LockedSpeedShift 3
  153. // define names for the TriggerType field of the general linedefs
  154. typedef enum
  155. {
  156. WalkOnce,
  157. WalkMany,
  158. SwitchOnce,
  159. SwitchMany,
  160. GunOnce,
  161. GunMany,
  162. PushOnce,
  163. PushMany,
  164. } triggertype_e;
  165. // define names for the Speed field of the general linedefs
  166. typedef enum
  167. {
  168. SpeedSlow,
  169. SpeedNormal,
  170. SpeedFast,
  171. SpeedTurbo,
  172. } motionspeed_e;
  173. // define names for the Target field of the general floor
  174. typedef enum
  175. {
  176. FtoHnF,
  177. FtoLnF,
  178. FtoNnF,
  179. FtoLnC,
  180. FtoC,
  181. FbyST,
  182. Fby24,
  183. Fby32,
  184. } floortarget_e;
  185. // define names for the Changer Type field of the general floor
  186. typedef enum
  187. {
  188. FNoChg,
  189. FChgZero,
  190. FChgTxt,
  191. FChgTyp,
  192. } floorchange_e;
  193. // define names for the Change Model field of the general floor
  194. typedef enum
  195. {
  196. FTriggerModel,
  197. FNumericModel,
  198. } floormodel_t;
  199. // define names for the Target field of the general ceiling
  200. typedef enum
  201. {
  202. CtoHnC,
  203. CtoLnC,
  204. CtoNnC,
  205. CtoHnF,
  206. CtoF,
  207. CbyST,
  208. Cby24,
  209. Cby32,
  210. } ceilingtarget_e;
  211. // define names for the Changer Type field of the general ceiling
  212. typedef enum
  213. {
  214. CNoChg,
  215. CChgZero,
  216. CChgTxt,
  217. CChgTyp,
  218. } ceilingchange_e;
  219. // define names for the Change Model field of the general ceiling
  220. typedef enum
  221. {
  222. CTriggerModel,
  223. CNumericModel,
  224. } ceilingmodel_t;
  225. // define names for the Target field of the general lift
  226. typedef enum
  227. {
  228. F2LnF,
  229. F2NnF,
  230. F2LnC,
  231. LnF2HnF,
  232. } lifttarget_e;
  233. // define names for the door Kind field of the general ceiling
  234. typedef enum
  235. {
  236. OdCDoor,
  237. ODoor,
  238. CdODoor,
  239. CDoor,
  240. } doorkind_e;
  241. // define names for the locked door Kind field of the general ceiling
  242. typedef enum
  243. {
  244. AnyKey,
  245. RCard,
  246. BCard,
  247. YCard,
  248. RSkull,
  249. BSkull,
  250. YSkull,
  251. AllKeys,
  252. } keykind_e;
  253. //////////////////////////////////////////////////////////////////
  254. //
  255. // enums for classes of linedef triggers
  256. //
  257. //////////////////////////////////////////////////////////////////
  258. //jff 2/23/98 identify the special classes that can share sectors
  259. typedef enum
  260. {
  261. floor_special,
  262. ceiling_special,
  263. lighting_special,
  264. } special_e;
  265. //jff 3/15/98 pure texture/type change for better generalized support
  266. typedef enum
  267. {
  268. trigChangeOnly,
  269. numChangeOnly,
  270. } change_e;
  271. // p_plats
  272. typedef enum
  273. {
  274. up,
  275. down,
  276. waiting,
  277. in_stasis
  278. } plat_e;
  279. typedef enum
  280. {
  281. perpetualRaise,
  282. downWaitUpStay,
  283. raiseAndChange,
  284. raiseToNearestAndChange,
  285. blazeDWUS,
  286. genLift, //jff added to support generalized Plat types
  287. genPerpetual,
  288. toggleUpDn, //jff 3/14/98 added to support instant toggle type
  289. } plattype_e;
  290. // p_doors
  291. typedef enum
  292. {
  293. normal,
  294. close30ThenOpen,
  295. close,
  296. open,
  297. raiseIn5Mins,
  298. blazeRaise,
  299. blazeOpen,
  300. blazeClose,
  301. //jff 02/05/98 add generalize door types
  302. genRaise,
  303. genBlazeRaise,
  304. genOpen,
  305. genBlazeOpen,
  306. genClose,
  307. genBlazeClose,
  308. genCdO,
  309. genBlazeCdO,
  310. } vldoor_e;
  311. // p_ceilng
  312. typedef enum
  313. {
  314. lowerToFloor,
  315. raiseToHighest,
  316. lowerToLowest,
  317. lowerToMaxFloor,
  318. lowerAndCrush,
  319. crushAndRaise,
  320. fastCrushAndRaise,
  321. silentCrushAndRaise,
  322. //jff 02/04/98 add types for generalized ceiling mover
  323. genCeiling,
  324. genCeilingChg,
  325. genCeilingChg0,
  326. genCeilingChgT,
  327. //jff 02/05/98 add types for generalized ceiling mover
  328. genCrusher,
  329. genSilentCrusher,
  330. } ceiling_e;
  331. // p_floor
  332. typedef enum
  333. {
  334. // lower floor to highest surrounding floor
  335. lowerFloor,
  336. // lower floor to lowest surrounding floor
  337. lowerFloorToLowest,
  338. // lower floor to highest surrounding floor VERY FAST
  339. turboLower,
  340. // raise floor to lowest surrounding CEILING
  341. raiseFloor,
  342. // raise floor to next highest surrounding floor
  343. raiseFloorToNearest,
  344. //jff 02/03/98 lower floor to next lowest neighbor
  345. lowerFloorToNearest,
  346. //jff 02/03/98 lower floor 24 absolute
  347. lowerFloor24,
  348. //jff 02/03/98 lower floor 32 absolute
  349. lowerFloor32Turbo,
  350. // raise floor to shortest height texture around it
  351. raiseToTexture,
  352. // lower floor to lowest surrounding floor
  353. // and change floorpic
  354. lowerAndChange,
  355. raiseFloor24,
  356. //jff 02/03/98 raise floor 32 absolute
  357. raiseFloor32Turbo,
  358. raiseFloor24AndChange,
  359. raiseFloorCrush,
  360. // raise to next highest floor, turbo-speed
  361. raiseFloorTurbo,
  362. donutRaise,
  363. raiseFloor512,
  364. //jff 02/04/98 add types for generalized floor mover
  365. genFloor,
  366. genFloorChg,
  367. genFloorChg0,
  368. genFloorChgT,
  369. //new types for stair builders
  370. buildStair,
  371. genBuildStair,
  372. } floor_e;
  373. typedef enum
  374. {
  375. build8, // slowly build by 8
  376. turbo16 // quickly build by 16
  377. } stair_e;
  378. typedef enum
  379. {
  380. elevateUp,
  381. elevateDown,
  382. elevateCurrent,
  383. } elevator_e;
  384. //////////////////////////////////////////////////////////////////
  385. //
  386. // general enums
  387. //
  388. //////////////////////////////////////////////////////////////////
  389. // texture type enum
  390. typedef enum
  391. {
  392. top,
  393. middle,
  394. bottom
  395. } bwhere_e;
  396. // crush check returns
  397. typedef enum
  398. {
  399. ok,
  400. crushed,
  401. pastdest
  402. } result_e;
  403. //////////////////////////////////////////////////////////////////
  404. //
  405. // linedef and sector special data types
  406. //
  407. //////////////////////////////////////////////////////////////////
  408. // p_switch
  409. // switch animation structure type
  410. #if defined(__MWERKS__)
  411. #pragma options align=packed
  412. #endif
  413. typedef struct
  414. {
  415. char name1[9];
  416. char name2[9];
  417. short episode;
  418. } PACKEDATTR switchlist_t; //jff 3/23/98 pack to read from memory
  419. #if defined(__MWERKS__)
  420. #pragma options align=reset
  421. #endif
  422. typedef struct
  423. {
  424. line_t* line;
  425. bwhere_e where;
  426. int btexture;
  427. int btimer;
  428. mobj_t* soundorg;
  429. } button_t;
  430. // p_lights
  431. typedef struct
  432. {
  433. thinker_t thinker;
  434. sector_t* sector;
  435. int count;
  436. int maxlight;
  437. int minlight;
  438. } fireflicker_t;
  439. typedef struct
  440. {
  441. thinker_t thinker;
  442. sector_t* sector;
  443. int count;
  444. int maxlight;
  445. int minlight;
  446. int maxtime;
  447. int mintime;
  448. } lightflash_t;
  449. typedef struct
  450. {
  451. thinker_t thinker;
  452. sector_t* sector;
  453. int count;
  454. int minlight;
  455. int maxlight;
  456. int darktime;
  457. int brighttime;
  458. } strobe_t;
  459. typedef struct
  460. {
  461. thinker_t thinker;
  462. sector_t* sector;
  463. int minlight;
  464. int maxlight;
  465. int direction;
  466. } glow_t;
  467. // p_plats
  468. typedef struct
  469. {
  470. thinker_t thinker;
  471. sector_t* sector;
  472. fixed_t speed;
  473. fixed_t low;
  474. fixed_t high;
  475. int wait;
  476. int count;
  477. plat_e status;
  478. plat_e oldstatus;
  479. boolean crush;
  480. int tag;
  481. plattype_e type;
  482. struct platlist *list; // killough
  483. } plat_t;
  484. // New limit-free plat structure -- killough
  485. typedef struct platlist {
  486. plat_t *plat;
  487. struct platlist *next,**prev;
  488. } platlist_t;
  489. // p_ceilng
  490. typedef struct
  491. {
  492. thinker_t thinker;
  493. vldoor_e type;
  494. sector_t* sector;
  495. fixed_t topheight;
  496. fixed_t speed;
  497. // 1 = up, 0 = waiting at top, -1 = down
  498. int direction;
  499. // tics to wait at the top
  500. int topwait;
  501. // (keep in case a door going down is reset)
  502. // when it reaches 0, start going down
  503. int topcountdown;
  504. //jff 1/31/98 keep track of line door is triggered by
  505. line_t *line;
  506. /* killough 10/98: sector tag for gradual lighting effects */
  507. int lighttag;
  508. } vldoor_t;
  509. // p_doors
  510. typedef struct
  511. {
  512. thinker_t thinker;
  513. ceiling_e type;
  514. sector_t* sector;
  515. fixed_t bottomheight;
  516. fixed_t topheight;
  517. fixed_t speed;
  518. fixed_t oldspeed;
  519. boolean crush;
  520. //jff 02/04/98 add these to support ceiling changers
  521. int newspecial;
  522. int oldspecial; //jff 3/14/98 add to fix bug in change transfers
  523. short texture;
  524. // 1 = up, 0 = waiting, -1 = down
  525. int direction;
  526. // ID
  527. int tag;
  528. int olddirection;
  529. struct ceilinglist *list; // jff 2/22/98 copied from killough's plats
  530. } ceiling_t;
  531. typedef struct ceilinglist {
  532. ceiling_t *ceiling;
  533. struct ceilinglist *next,**prev;
  534. } ceilinglist_t;
  535. // p_floor
  536. typedef struct
  537. {
  538. thinker_t thinker;
  539. floor_e type;
  540. boolean crush;
  541. sector_t* sector;
  542. int direction;
  543. int newspecial;
  544. int oldspecial; //jff 3/14/98 add to fix bug in change transfers
  545. short texture;
  546. fixed_t floordestheight;
  547. fixed_t speed;
  548. } floormove_t;
  549. typedef struct
  550. {
  551. thinker_t thinker;
  552. elevator_e type;
  553. sector_t* sector;
  554. int direction;
  555. fixed_t floordestheight;
  556. fixed_t ceilingdestheight;
  557. fixed_t speed;
  558. } elevator_t;
  559. // p_spec
  560. // killough 3/7/98: Add generalized scroll effects
  561. typedef struct {
  562. thinker_t thinker; // Thinker structure for scrolling
  563. fixed_t dx, dy; // (dx,dy) scroll speeds
  564. int affectee; // Number of affected sidedef, sector, tag, or whatever
  565. int control; // Control sector (-1 if none) used to control scrolling
  566. fixed_t last_height; // Last known height of control sector
  567. fixed_t vdx, vdy; // Accumulated velocity if accelerative
  568. int accel; // Whether it's accelerative
  569. enum
  570. {
  571. sc_side,
  572. sc_floor,
  573. sc_ceiling,
  574. sc_carry,
  575. sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings
  576. } type; // Type of scroll effect
  577. } scroll_t;
  578. // phares 3/12/98: added new model of friction for ice/sludge effects
  579. typedef struct {
  580. thinker_t thinker; // Thinker structure for friction
  581. int friction; // friction value (E800 = normal)
  582. int movefactor; // inertia factor when adding to momentum
  583. int affectee; // Number of affected sector
  584. } friction_t;
  585. // phares 3/20/98: added new model of Pushers for push/pull effects
  586. typedef struct {
  587. thinker_t thinker; // Thinker structure for Pusher
  588. enum
  589. {
  590. p_push,
  591. p_pull,
  592. p_wind,
  593. p_current,
  594. } type;
  595. mobj_t* source; // Point source if point pusher
  596. int x_mag; // X Strength
  597. int y_mag; // Y Strength
  598. int magnitude; // Vector strength for point pusher
  599. int radius; // Effective radius for point pusher
  600. int x; // X of point source if point pusher
  601. int y; // Y of point source if point pusher
  602. int affectee; // Number of affected sector
  603. } pusher_t;
  604. //////////////////////////////////////////////////////////////////
  605. //
  606. // external data declarations
  607. //
  608. //////////////////////////////////////////////////////////////////
  609. // list of retriggerable buttons active
  610. extern button_t buttonlist[MAXBUTTONS];
  611. extern platlist_t *activeplats; // killough 2/14/98
  612. extern ceilinglist_t *activeceilings; // jff 2/22/98
  613. ////////////////////////////////////////////////////////////////
  614. //
  615. // Linedef and sector special utility function prototypes
  616. //
  617. ////////////////////////////////////////////////////////////////
  618. int twoSided
  619. ( int sector,
  620. int line );
  621. sector_t* getSector
  622. ( int currentSector,
  623. int line,
  624. int side );
  625. side_t* getSide
  626. ( int currentSector,
  627. int line,
  628. int side );
  629. fixed_t P_FindLowestFloorSurrounding
  630. ( sector_t* sec );
  631. fixed_t P_FindHighestFloorSurrounding
  632. ( sector_t* sec );
  633. fixed_t P_FindNextHighestFloor
  634. ( sector_t* sec,
  635. int currentheight );
  636. fixed_t P_FindNextLowestFloor
  637. ( sector_t* sec,
  638. int currentheight );
  639. fixed_t P_FindLowestCeilingSurrounding
  640. ( sector_t* sec ); // jff 2/04/98
  641. fixed_t P_FindHighestCeilingSurrounding
  642. ( sector_t* sec ); // jff 2/04/98
  643. fixed_t P_FindNextLowestCeiling
  644. ( sector_t *sec,
  645. int currentheight ); // jff 2/04/98
  646. fixed_t P_FindNextHighestCeiling
  647. ( sector_t *sec,
  648. int currentheight ); // jff 2/04/98
  649. fixed_t P_FindShortestTextureAround
  650. ( int secnum ); // jff 2/04/98
  651. fixed_t P_FindShortestUpperAround
  652. ( int secnum ); // jff 2/04/98
  653. sector_t* P_FindModelFloorSector
  654. ( fixed_t floordestheight,
  655. int secnum ); //jff 02/04/98
  656. sector_t* P_FindModelCeilingSector
  657. ( fixed_t ceildestheight,
  658. int secnum ); //jff 02/04/98
  659. int P_FindSectorFromLineTag
  660. ( const line_t *line,
  661. int start ); // killough 4/17/98
  662. int P_FindLineFromLineTag
  663. ( const line_t *line,
  664. int start ); // killough 4/17/98
  665. int P_FindMinSurroundingLight
  666. ( sector_t* sector,
  667. int max );
  668. sector_t* getNextSector
  669. ( line_t* line,
  670. sector_t* sec );
  671. int P_CheckTag
  672. (line_t *line); // jff 2/27/98
  673. boolean P_CanUnlockGenDoor
  674. ( line_t* line,
  675. player_t* player);
  676. boolean PUREFUNC P_SectorActive
  677. ( special_e t,
  678. const sector_t* s );
  679. boolean PUREFUNC P_IsSecret
  680. ( const sector_t *sec );
  681. boolean PUREFUNC P_WasSecret
  682. ( const sector_t *sec );
  683. void P_ChangeSwitchTexture
  684. ( line_t* line,
  685. int useAgain );
  686. ////////////////////////////////////////////////////////////////
  687. //
  688. // Linedef and sector special action function prototypes
  689. //
  690. ////////////////////////////////////////////////////////////////
  691. // p_lights
  692. void T_LightFlash
  693. ( lightflash_t* flash );
  694. void T_StrobeFlash
  695. ( strobe_t* flash );
  696. // jff 8/8/98 add missing thinker for flicker
  697. void T_FireFlicker
  698. ( fireflicker_t* flick );
  699. void T_Glow
  700. ( glow_t* g );
  701. // p_plats
  702. void T_PlatRaise
  703. ( plat_t* plat );
  704. // p_doors
  705. void T_VerticalDoor
  706. ( vldoor_t* door );
  707. // p_ceilng
  708. void T_MoveCeiling
  709. ( ceiling_t* ceiling );
  710. // p_floor
  711. result_e T_MovePlane
  712. ( sector_t* sector,
  713. fixed_t speed,
  714. fixed_t dest,
  715. boolean crush,
  716. int floorOrCeiling,
  717. int direction );
  718. void T_MoveFloor
  719. ( floormove_t* floor );
  720. void T_MoveElevator
  721. ( elevator_t* elevator );
  722. // p_spec
  723. void T_Scroll
  724. ( scroll_t * ); // killough 3/7/98: scroll effect thinker
  725. void T_Friction
  726. ( friction_t * ); // phares 3/12/98: friction thinker
  727. void T_Pusher
  728. ( pusher_t * ); // phares 3/20/98: Push thinker
  729. ////////////////////////////////////////////////////////////////
  730. //
  731. // Linedef and sector special handler prototypes
  732. //
  733. ////////////////////////////////////////////////////////////////
  734. // p_telept
  735. int EV_Teleport
  736. ( line_t* line,
  737. int side,
  738. mobj_t* thing );
  739. // killough 2/14/98: Add silent teleporter
  740. int EV_SilentTeleport
  741. ( line_t* line,
  742. int side,
  743. mobj_t* thing );
  744. // killough 1/31/98: Add silent line teleporter
  745. int EV_SilentLineTeleport
  746. ( line_t* line,
  747. int side,
  748. mobj_t* thing,
  749. boolean reverse);
  750. // p_floor
  751. int
  752. EV_DoElevator
  753. ( line_t* line,
  754. elevator_e type );
  755. int EV_BuildStairs
  756. ( line_t* line,
  757. stair_e type );
  758. int EV_DoFloor
  759. ( line_t* line,
  760. floor_e floortype );
  761. // p_ceilng
  762. int EV_DoCeiling
  763. ( line_t* line,
  764. ceiling_e type );
  765. int EV_CeilingCrushStop
  766. ( line_t* line );
  767. // p_doors
  768. int EV_VerticalDoor
  769. ( line_t* line,
  770. mobj_t* thing );
  771. int EV_DoDoor
  772. ( line_t* line,
  773. vldoor_e type );
  774. int EV_DoLockedDoor
  775. ( line_t* line,
  776. vldoor_e type,
  777. mobj_t* thing );
  778. // p_lights
  779. int EV_StartLightStrobing
  780. ( line_t* line );
  781. int EV_TurnTagLightsOff
  782. ( line_t* line );
  783. int EV_LightTurnOn
  784. ( line_t* line,
  785. int bright );
  786. int EV_LightTurnOnPartway(line_t* line, fixed_t level); // killough 10/10/98
  787. // p_floor
  788. int EV_DoChange
  789. ( line_t* line,
  790. change_e changetype );
  791. int EV_DoDonut
  792. ( line_t* line );
  793. // p_plats
  794. int EV_DoPlat
  795. ( line_t* line,
  796. plattype_e type,
  797. int amount );
  798. int EV_StopPlat
  799. ( line_t* line );
  800. // p_genlin
  801. int EV_DoGenFloor
  802. ( line_t* line );
  803. int EV_DoGenCeiling
  804. ( line_t* line );
  805. int EV_DoGenLift
  806. ( line_t* line );
  807. int EV_DoGenStairs
  808. ( line_t* line );
  809. int EV_DoGenCrusher
  810. ( line_t* line );
  811. int EV_DoGenDoor
  812. ( line_t* line );
  813. int EV_DoGenLockedDoor
  814. ( line_t* line );
  815. ////////////////////////////////////////////////////////////////
  816. //
  817. // Linedef and sector special thinker spawning
  818. //
  819. ////////////////////////////////////////////////////////////////
  820. // at game start
  821. void P_InitPicAnims
  822. ( void );
  823. void P_InitSwitchList
  824. ( void );
  825. // at map load
  826. void P_SpawnSpecials
  827. ( void );
  828. // every tic
  829. void P_UpdateSpecials
  830. ( void );
  831. // when needed
  832. boolean P_UseSpecialLine
  833. ( mobj_t* thing,
  834. line_t* line,
  835. int side );
  836. void P_ShootSpecialLine
  837. ( mobj_t* thing,
  838. line_t* line );
  839. void P_CrossSpecialLine(line_t *line, int side, mobj_t *thing);
  840. void P_PlayerInSpecialSector
  841. ( player_t* player );
  842. // p_lights
  843. void P_SpawnFireFlicker
  844. ( sector_t* sector );
  845. void P_SpawnLightFlash
  846. ( sector_t* sector );
  847. void P_SpawnStrobeFlash
  848. ( sector_t* sector,
  849. int fastOrSlow,
  850. int inSync );
  851. void P_SpawnGlowingLight
  852. ( sector_t* sector );
  853. // p_plats
  854. void P_AddActivePlat
  855. ( plat_t* plat );
  856. void P_RemoveActivePlat
  857. ( plat_t* plat );
  858. void P_RemoveAllActivePlats
  859. ( void ); // killough
  860. void P_ActivateInStasis
  861. ( int tag );
  862. // p_doors
  863. void P_SpawnDoorCloseIn30
  864. ( sector_t* sec );
  865. void P_SpawnDoorRaiseIn5Mins
  866. ( sector_t* sec,
  867. int secnum );
  868. // p_ceilng
  869. void P_RemoveActiveCeiling
  870. ( ceiling_t* ceiling ); //jff 2/22/98
  871. void P_RemoveAllActiveCeilings
  872. ( void ); //jff 2/22/98
  873. void P_AddActiveCeiling
  874. ( ceiling_t* c );
  875. int P_ActivateInStasisCeiling
  876. ( line_t* line );
  877. mobj_t* P_GetPushThing(int); // phares 3/23/98
  878. #endif