mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Renamed some object flags
This commit is contained in:
@@ -11,14 +11,10 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "..\headers\define.h"
|
#include "..\headers\global.h"
|
||||||
//#include "..\headers\command.h"
|
#include "..\headers\critrpid.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#define OBJ_DATA_LIGHT_DISTANCE (0x6C)
|
|
||||||
#define OBJ_DATA_LIGHT_INTENSITY (0x70)
|
|
||||||
#define PID_PLAYER (16777216)
|
|
||||||
|
|
||||||
procedure start;
|
procedure start;
|
||||||
procedure AllowControl(variable pid);
|
procedure AllowControl(variable pid);
|
||||||
procedure SetLight(variable critter, variable int, variable dist);
|
procedure SetLight(variable critter, variable int, variable dist);
|
||||||
|
|||||||
@@ -130,12 +130,12 @@
|
|||||||
detail: get_stat_min(int stat, bool who = False)
|
detail: get_stat_min(int stat, bool who = False)
|
||||||
doc: |
|
doc: |
|
||||||
- Returns the minimum set value of the specified stat (see `set_stat_min` functions)
|
- Returns the minimum set value of the specified stat (see `set_stat_min` functions)
|
||||||
- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
|
- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters
|
||||||
- name: get_stat_max
|
- name: get_stat_max
|
||||||
detail: get_stat_max(int stat, bool who = False)
|
detail: get_stat_max(int stat, bool who = False)
|
||||||
doc: |
|
doc: |
|
||||||
- Returns the maximum set value of the specified stat (see `set_stat_max` functions)
|
- Returns the maximum set value of the specified stat (see `set_stat_max` functions)
|
||||||
- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
|
- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters
|
||||||
|
|
||||||
- name: Alter min/max
|
- name: Alter min/max
|
||||||
doc: The `set_stat_max/min` functions can be used to set the valid ranges on stats. Values returned by `get_current_stat` will be clamped to this range. The `set_pc_` function only affects the player, the `set_npc_` functions only affects other critters, and the `set_` functions affects both.
|
doc: The `set_stat_max/min` functions can be used to set the valid ranges on stats. Values returned by `get_current_stat` will be clamped to this range. The `set_pc_` function only affects the player, the `set_npc_` functions only affects other critters, and the `set_` functions affects both.
|
||||||
@@ -1680,7 +1680,7 @@
|
|||||||
- winName: the window name, assigned to the window by the `CreateWin/create_win` function
|
- winName: the window name, assigned to the window by the `CreateWin/create_win` function
|
||||||
- winID: the ID number of the interface or script window obtained with the `get_window_under_mouse` function, or 0 for the current game interface
|
- winID: the ID number of the interface or script window obtained with the `get_window_under_mouse` function, or 0 for the current game interface
|
||||||
- flag: the flag to change (see `WIN_FLAG_*` constants in `define_extra.h`)
|
- flag: the flag to change (see `WIN_FLAG_*` constants in `define_extra.h`)
|
||||||
- value: `true` - set the flag, `false` - unset the flag
|
- value: `True` - set the flag, `False` - unset the flag
|
||||||
macro: sfall.h
|
macro: sfall.h
|
||||||
|
|
||||||
- name: win_fill_color
|
- name: win_fill_color
|
||||||
@@ -1925,5 +1925,5 @@
|
|||||||
|
|
||||||
- name: obj_is_openable
|
- name: obj_is_openable
|
||||||
detail: bool obj_is_openable(object obj)
|
detail: bool obj_is_openable(object obj)
|
||||||
doc: Returns True if the object is openable (i.e. has an opening/closing animation)
|
doc: Returns True if the object is openable (i.e. has an opening/closing animation), False otherwise
|
||||||
macro: sfall.h
|
macro: sfall.h
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
#ifndef DEFINE_EXTRA_H
|
#ifndef DEFINE_EXTRA_H
|
||||||
#define DEFINE_EXTRA_H
|
#define DEFINE_EXTRA_H
|
||||||
|
|
||||||
|
#define PID_PLAYER (16777216)
|
||||||
|
|
||||||
/* Combat Flags */
|
/* Combat Flags */
|
||||||
#define DAM_PRESERVE_FLAGS 0x80000000 // keep the existing result flags when setting new flags in attack_complex (for sfall)
|
#define DAM_PRESERVE_FLAGS (0x80000000) // keep the existing result flags when setting new flags in attack_complex (for sfall)
|
||||||
|
|
||||||
#define BODY_HIT_HEAD (0)
|
#define BODY_HIT_HEAD (0)
|
||||||
#define BODY_HIT_LEFT_ARM (1)
|
#define BODY_HIT_LEFT_ARM (1)
|
||||||
@@ -67,12 +69,12 @@
|
|||||||
#define ATKMODE_SEC_FLAME 128 // 0x00000080
|
#define ATKMODE_SEC_FLAME 128 // 0x00000080
|
||||||
|
|
||||||
/* Object flags for get/set_flags */
|
/* Object flags for get/set_flags */
|
||||||
#define FLAG_MOUSE_3D (0x1)
|
#define FLAG_HIDDEN (0x1)
|
||||||
#define FLAG_WALKTHRU (0x4)
|
#define FLAG_NOSAVE (0x4)
|
||||||
#define FLAG_FLAT (0x8)
|
#define FLAG_FLAT (0x8)
|
||||||
#define FLAG_NOBLOCK (0x10)
|
#define FLAG_NOBLOCK (0x10)
|
||||||
#define FLAG_LIGHTING (0x20)
|
#define FLAG_LIGHTING (0x20)
|
||||||
#define FLAG_TEMP (0x400)
|
#define FLAG_NOREMOVE (0x400)
|
||||||
#define FLAG_MULTIHEX (0x800)
|
#define FLAG_MULTIHEX (0x800)
|
||||||
#define FLAG_NOHIGHLIGHT (0x1000)
|
#define FLAG_NOHIGHLIGHT (0x1000)
|
||||||
#define FLAG_USED (0x2000)
|
#define FLAG_USED (0x2000)
|
||||||
@@ -105,6 +107,9 @@
|
|||||||
#define CFLG_NOKNOCKBACK 16384 // 0x00004000 - Knock (cannot be knocked back)
|
#define CFLG_NOKNOCKBACK 16384 // 0x00004000 - Knock (cannot be knocked back)
|
||||||
#define CFLG_NOKNOCKDOWN CFLG_NOKNOCKBACK // obsolete
|
#define CFLG_NOKNOCKDOWN CFLG_NOKNOCKBACK // obsolete
|
||||||
|
|
||||||
|
/* Door flags */
|
||||||
|
#define FLAG_WALKTHRU (0x4)
|
||||||
|
|
||||||
/* Window flags */
|
/* Window flags */
|
||||||
#define WIN_FLAG_DONTMOVE (0x2) // does not move the window to the foreground when clicking on the window
|
#define WIN_FLAG_DONTMOVE (0x2) // does not move the window to the foreground when clicking on the window
|
||||||
#define WIN_FLAG_MOVEONTOP (0x4) // places the window on top of other windows
|
#define WIN_FLAG_MOVEONTOP (0x4) // places the window on top of other windows
|
||||||
@@ -424,6 +429,8 @@
|
|||||||
#define OBJ_DATA_MISC_FLAGS (0x38)
|
#define OBJ_DATA_MISC_FLAGS (0x38)
|
||||||
#define OBJ_DATA_PID (0x64)
|
#define OBJ_DATA_PID (0x64)
|
||||||
#define OBJ_DATA_CID (0x68) // combat ID, used by critters in savegame (don't change while in combat)
|
#define OBJ_DATA_CID (0x68) // combat ID, used by critters in savegame (don't change while in combat)
|
||||||
|
#define OBJ_DATA_LIGHT_DISTANCE (0x6C)
|
||||||
|
#define OBJ_DATA_LIGHT_INTENSITY (0x70)
|
||||||
#define OBJ_DATA_SID (0x78) // script ID
|
#define OBJ_DATA_SID (0x78) // script ID
|
||||||
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
|
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
|
||||||
// items
|
// items
|
||||||
|
|||||||
@@ -243,12 +243,12 @@ enum class Material : long
|
|||||||
|
|
||||||
namespace ObjectFlag {
|
namespace ObjectFlag {
|
||||||
enum ObjectFlag : unsigned long {
|
enum ObjectFlag : unsigned long {
|
||||||
Mouse_3d = 0x00000001,
|
Hidden = 0x00000001,
|
||||||
WalkThru = 0x00000004,
|
NoSave = 0x00000004, // WalkThru flag for doors
|
||||||
Flat = 0x00000008,
|
Flat = 0x00000008,
|
||||||
NoBlock = 0x00000010,
|
NoBlock = 0x00000010,
|
||||||
Lighting = 0x00000020,
|
Lighting = 0x00000020,
|
||||||
Temp = 0x00000400, // ???
|
NoRemove = 0x00000400,
|
||||||
MultiHex = 0x00000800,
|
MultiHex = 0x00000800,
|
||||||
NoHighlight = 0x00001000,
|
NoHighlight = 0x00001000,
|
||||||
Used = 0x00002000, // set if there was/is any event for the object
|
Used = 0x00002000, // set if there was/is any event for the object
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ static fo::GameObject* __fastcall obj_path_blocking_at(fo::GameObject* source, l
|
|||||||
if (elev == obj->object->elevation) {
|
if (elev == obj->object->elevation) {
|
||||||
fo::GameObject* object = obj->object;
|
fo::GameObject* object = obj->object;
|
||||||
long flags = object->flags;
|
long flags = object->flags;
|
||||||
if (!(flags & (fo::ObjectFlag::Mouse_3d | fo::ObjectFlag::NoBlock)) && source != object) {
|
if (!(flags & (fo::ObjectFlag::Hidden | fo::ObjectFlag::NoBlock)) && source != object) {
|
||||||
char type = object->TypeFid();
|
char type = object->TypeFid();
|
||||||
if (type == fo::ObjType::OBJ_TYPE_SCENERY || type == fo::ObjType::OBJ_TYPE_WALL) {
|
if (type == fo::ObjType::OBJ_TYPE_SCENERY || type == fo::ObjType::OBJ_TYPE_WALL) {
|
||||||
return object;
|
return object;
|
||||||
@@ -44,7 +44,7 @@ static fo::GameObject* __fastcall obj_path_blocking_at(fo::GameObject* source, l
|
|||||||
if (elev == obj->object->elevation) {
|
if (elev == obj->object->elevation) {
|
||||||
fo::GameObject* object = obj->object;
|
fo::GameObject* object = obj->object;
|
||||||
long flags = object->flags;
|
long flags = object->flags;
|
||||||
if (flags & fo::ObjectFlag::MultiHex && !(flags & (fo::ObjectFlag::Mouse_3d | fo::ObjectFlag::NoBlock)) && source != object) {
|
if (flags & fo::ObjectFlag::MultiHex && !(flags & (fo::ObjectFlag::Hidden | fo::ObjectFlag::NoBlock)) && source != object) {
|
||||||
char type = object->TypeFid();
|
char type = object->TypeFid();
|
||||||
if (type == fo::ObjType::OBJ_TYPE_SCENERY || type == fo::ObjType::OBJ_TYPE_WALL) {
|
if (type == fo::ObjType::OBJ_TYPE_SCENERY || type == fo::ObjType::OBJ_TYPE_WALL) {
|
||||||
return object;
|
return object;
|
||||||
|
|||||||
@@ -1160,7 +1160,7 @@ static void __declspec(naked) obj_load_func_hack() {
|
|||||||
static const DWORD obj_load_func_Ret = 0x488F14;
|
static const DWORD obj_load_func_Ret = 0x488F14;
|
||||||
using fo::InCombat;
|
using fo::InCombat;
|
||||||
__asm {
|
__asm {
|
||||||
test word ptr [eax + flags], Temp; // engine code
|
test word ptr [eax + flags], NoRemove; // engine code
|
||||||
jz fix;
|
jz fix;
|
||||||
retn;
|
retn;
|
||||||
fix:
|
fix:
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ void op_get_party_members(OpcodeContext& ctx) {
|
|||||||
DWORD arrayId = CreateTempArray(0, 4);
|
DWORD arrayId = CreateTempArray(0, 4);
|
||||||
for (int i = 0; i < actualCount; i++) {
|
for (int i = 0; i < actualCount; i++) {
|
||||||
fo::GameObject* obj = fo::var::partyMemberList[i].object;
|
fo::GameObject* obj = fo::var::partyMemberList[i].object;
|
||||||
if (includeHidden || (obj->IsCritter() && !fo::func::critter_is_dead(obj) && !(obj->flags & fo::ObjectFlag::Mouse_3d))) {
|
if (includeHidden || (obj->IsCritter() && !fo::func::critter_is_dead(obj) && !(obj->flags & fo::ObjectFlag::Hidden))) {
|
||||||
arrays[arrayId].push_back((long)obj);
|
arrays[arrayId].push_back((long)obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user