GameMsg.pas
资源名称:CAST2SDK.rar [点击查看]
上传用户:yj_qiu
上传日期:2022-08-08
资源大小:23636k
文件大小:3k
源码类别:
游戏引擎
开发平台:
Delphi
- (*
- @Abstract(Game messages unit)
- (C) 2006-2007 George "Mirage" Bakhtadze. avagames@gmail.com
- Created: Mar 22, 2007
- Unit contains game-specific message classes
- *)
- {$I GDefines.inc}
- unit GameMsg;
- interface
- uses BaseMsg;
- type
- TGameItem = (giTorch, giSmallBag, giMediumBag, giBigBag, giPick, giLockPick, giTeleport);
- // Game over
- TGameOverMsg = class(BaseMsg.TMessage)
- end;
- // Timeout message. Used to remove spash screens after some time.
- TTimeOutMsg = class(BaseMsg.TMessage)
- end;
- // Occures when inventory window should be toggled
- TInventoryToggleMsg = class(BaseMsg.TMessage)
- end;
- // Occures when teleport used
- TTeleportUseMsg = class(BaseMsg.TMessage)
- end;
- // Occures when user presses action key
- TGameActionMsg = class(BaseMsg.TMessage)
- end;
- // Occures when user presses fire key
- TFireMsg = class(BaseMsg.TMessage)
- end;
- // Occures when a gem is encountered
- TGemFoundMsg = class(BaseMsg.TMessage)
- TileX, TileY, ItemType: Integer;
- constructor Create(AItemType, ATileX, ATileY: Integer);
- end;
- // Occures when a gem is actually picked up (enough free space in inventory, etc)
- TGemPickedUpMsg = class(BaseMsg.TMessage)
- GemType: Integer;
- constructor Create(AGemType: Integer);
- end;
- // Occures when some item lacks to perform an action
- TItemLackMsg = class(BaseMsg.TMessage)
- ItemType: TGameItem;
- constructor Create(AItemType: TGameItem);
- end;
- // Occures when player takes contents of a chest
- TEmptyChestMsg = class(BaseMsg.TMessage)
- end;
- // Occures when shop window should be opened
- TShopOpenMsg = class(BaseMsg.TMessage)
- end;
- // Occures when shop window should be closed
- TShopCloseMsg = class(BaseMsg.TMessage)
- end;
- // Cheat code base message
- TCheatCodeMsg = class(BaseMsg.TMessage)
- end;
- // Occures when a god mode should be applied to character
- TGodModeToggleMsg = class(TCheatCodeMsg)
- end;
- // Occures when "1000 torches" cheat should be activated
- TThousandTorchesMsg = class(TCheatCodeMsg)
- end;
- // Occures when "give money" cheat should be activated
- TGiveMoneyMsg = class(TCheatCodeMsg)
- end;
- implementation
- { TItemFoundMsg }
- constructor TGemFoundMsg.Create(AItemType, ATileX, ATileY: Integer);
- begin
- ItemType := AItemType;
- TileX := ATileX;
- TileY := ATileY;
- end;
- { TGemPickedUpMsg }
- constructor TGemPickedUpMsg.Create(AGemType: Integer);
- begin
- GemType := AGemType;
- end;
- { TItemLackMsg }
- constructor TItemLackMsg.Create(AItemType: TGameItem);
- begin
- ItemType := AItemType;
- end;
- end.