mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b649c416c | ||
|
|
1a50bebff1 |
@@ -98,7 +98,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
|
||||
| KeyPress | `HOOK_KEYPRESS` | âś… | Third hook arg is currently `0`; CE doesn't use VK codes. |
|
||||
| MouseClick | `HOOK_MOUSECLICK` | âś… | - |
|
||||
| UseSkill | `HOOK_USESKILL` | đźš« | - |
|
||||
| Steal | `HOOK_STEAL` | đźš« | Et tu |
|
||||
| Steal | `HOOK_STEAL` | âś… | - |
|
||||
| WithinPerception | `HOOK_WITHINPERCEPTION` | âś… | - |
|
||||
| InventoryMove | `HOOK_INVENTORYMOVE` | âś… | - |
|
||||
| InvenWield | `HOOK_INVENWIELD` | âś… | - |
|
||||
|
||||
@@ -98,6 +98,8 @@ auto_quick_save=3
|
||||
display_bonus_damage=1
|
||||
;Set to 1 to get notification of karma changes in the notification window
|
||||
display_karma_changes=0
|
||||
;Set to 1 to use the hi-res dialog border/background at resolutions above 640x480. Requires art\intrface\HR_ALLTLK.FRM (for example from f2_res.dat)
|
||||
enable_dialog_border=1
|
||||
;Set to one to hide areas outside map bounds when using higher than 640x480 resolution, and to zero to disable
|
||||
enable_high_resolution_stencil=1
|
||||
;Set to 1 to extend the action points bar to show up to 16 AP instead of 10 (requires iface_apbar_e.frm)
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
#include "sfall.h"
|
||||
#include "dik.h"
|
||||
#include "lib.arrays.h"
|
||||
|
||||
variable steal_mode := 0;
|
||||
|
||||
procedure steal_mode_name(variable mode) begin
|
||||
if (mode == 1) then return "force_success";
|
||||
if (mode == 2) then return "caught_fail";
|
||||
if (mode == 3) then return "silent_fail";
|
||||
if (mode == 4) then return "xp_override";
|
||||
return "vanilla";
|
||||
end
|
||||
|
||||
procedure steal_handler begin
|
||||
variable
|
||||
args := get_sfall_args,
|
||||
thief := args[0],
|
||||
target := args[1],
|
||||
item := args[2],
|
||||
is_planting := args[3],
|
||||
quantity := args[4],
|
||||
thief_name := "<null>",
|
||||
target_name := "<null>",
|
||||
item_name := "<null>";
|
||||
|
||||
if (thief) then thief_name := obj_name(thief);
|
||||
if (target) then target_name := obj_name(target);
|
||||
if (item) then item_name := obj_name(item);
|
||||
|
||||
display_msg(string_format6("steal mode=%s thief=%s target=%s item=%s planting=%d qty=%d",
|
||||
steal_mode_name(steal_mode),
|
||||
thief_name,
|
||||
target_name,
|
||||
item_name,
|
||||
is_planting,
|
||||
quantity));
|
||||
display_msg(string_format1("steal args=%s", debug_array_str(args)));
|
||||
|
||||
if (thief != dude_obj) then return;
|
||||
|
||||
if (steal_mode == 1) then begin
|
||||
display_msg("steal forcing success");
|
||||
display_msg(sprintf(mstr_skill(571 + is_planting * 2), item_name));
|
||||
set_sfall_return(1);
|
||||
end else if (steal_mode == 2) then begin
|
||||
display_msg("steal forcing caught failure");
|
||||
display_msg(sprintf(mstr_skill(570 + is_planting * 2), item_name));
|
||||
set_sfall_return(0);
|
||||
end else if (steal_mode == 3) then begin
|
||||
display_msg("steal forcing silent failure");
|
||||
set_sfall_return(2);
|
||||
end else if (steal_mode == 4) then begin
|
||||
display_msg("steal forcing success with xp override 77");
|
||||
display_msg(sprintf(mstr_skill(571 + is_planting * 2), item_name));
|
||||
set_sfall_return(1);
|
||||
set_sfall_return(77);
|
||||
end
|
||||
end
|
||||
|
||||
procedure keypress_handler begin
|
||||
variable
|
||||
pressed := get_sfall_arg_at(0),
|
||||
key := get_sfall_arg_at(1);
|
||||
|
||||
if (not pressed) then return;
|
||||
if (key != DIK_X) then return;
|
||||
|
||||
steal_mode += 1;
|
||||
if (steal_mode > 4) then steal_mode := 0;
|
||||
|
||||
display_msg(string_format1("steal mode -> %s", steal_mode_name(steal_mode)));
|
||||
end
|
||||
|
||||
procedure start begin
|
||||
if (not game_loaded) then return;
|
||||
|
||||
display_msg("steal manual test ready: press X to cycle vanilla / force_success / caught_fail / silent_fail / xp_override");
|
||||
display_msg("open a steal screen and move an item in either direction; mode 4 should award 77 XP for a successful action");
|
||||
|
||||
register_hook_proc(HOOK_KEYPRESS, keypress_handler);
|
||||
register_hook_proc(HOOK_STEAL, steal_handler);
|
||||
end
|
||||
+2
-48
@@ -447,57 +447,11 @@ void artRender(int fid, unsigned char* dest, int width, int height, int pitch)
|
||||
// mapper2.exe: 0x40A03C
|
||||
int art_list_str(int fid, char* name)
|
||||
{
|
||||
if (fid == -1 || name == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
// TODO: Incomplete.
|
||||
|
||||
int objectType = (fid & 0xF000000) >> 24;
|
||||
int index = fid & 0xFFF;
|
||||
|
||||
const char* typeName = artGetObjectTypeName(objectType);
|
||||
if (typeName == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
char path[260];
|
||||
snprintf(path, sizeof(path), "%s%s%s\\%s.lst", _cd_path_base, "art\\", typeName, typeName);
|
||||
|
||||
File* stream = fileOpen(path, "rt");
|
||||
if (stream == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
char buffer[260];
|
||||
int line = 0;
|
||||
bool found = false;
|
||||
while (fileReadString(buffer, sizeof(buffer), stream) != nullptr) {
|
||||
if (line == index) {
|
||||
char* p = buffer;
|
||||
while (*p) {
|
||||
if (*p == ' ' || *p == '\n') {
|
||||
*p = '\0';
|
||||
break;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
char* dst = name;
|
||||
const char* src = buffer;
|
||||
do {
|
||||
*dst++ = *src++;
|
||||
*dst++ = *src++;
|
||||
} while (dst[-2] != '\0' || dst[-1] != '\0');
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
line++;
|
||||
}
|
||||
|
||||
fileClose(stream);
|
||||
|
||||
return found ? 0 : -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// art_list_index
|
||||
int artListIndex(int objectType, const char* name)
|
||||
{
|
||||
if (objectType < 0 || objectType >= OBJ_TYPE_COUNT) return -1;
|
||||
|
||||
+2
-1
@@ -86,6 +86,7 @@ namespace fallout {
|
||||
#define SPLASH_HEIGHT (480)
|
||||
#define SPLASH_COUNT (10)
|
||||
|
||||
static int gameLoadGlobalVars();
|
||||
static int gameTakeScreenshot(int width, int height, unsigned char* buffer, unsigned char* palette);
|
||||
static void gameFreeGlobalVars();
|
||||
static bool tryLoadBaseCEModAtPath(const char* path, bool* found, bool* openFailed);
|
||||
@@ -1015,7 +1016,7 @@ int gameSetGlobalVar(int var, int value)
|
||||
|
||||
// game_load_info
|
||||
// 0x443CC8
|
||||
int gameLoadGlobalVars()
|
||||
static int gameLoadGlobalVars()
|
||||
{
|
||||
if (globalVarsRead("data\\vault13.gam", "GAME_GLOBAL_VARS:", &gGameGlobalVarsLength, &gGameGlobalVars) != 0) {
|
||||
return -1;
|
||||
|
||||
@@ -47,7 +47,6 @@ int gameRequestState(int newGameState);
|
||||
void gameUpdateState();
|
||||
int showQuitConfirmationDialog();
|
||||
|
||||
int gameLoadGlobalVars();
|
||||
int gameShowDeathDialog(const char* message);
|
||||
void gameHandleSkilldexResult(int rc);
|
||||
void* gameGetGlobalPointer(int var);
|
||||
|
||||
+85
-29
@@ -279,6 +279,8 @@ static int gGameDialogBackgroundWindow = -1;
|
||||
// 0x518744
|
||||
static int gGameDialogWindow = -1;
|
||||
|
||||
static bool gameDialogUseHrArt = false;
|
||||
|
||||
// 0x518748
|
||||
static Rect _backgrndRects[8] = {
|
||||
{ 126, 14, 152, 40 },
|
||||
@@ -291,6 +293,37 @@ static Rect _backgrndRects[8] = {
|
||||
{ 504, 40, 514, 188 },
|
||||
};
|
||||
|
||||
static bool gameDialogShouldUseHrArt()
|
||||
{
|
||||
return settings.ui.enable_dialog_border
|
||||
&& (screenGetWidth() > GAME_DIALOG_WINDOW_WIDTH || screenGetHeight() > GAME_DIALOG_WINDOW_HEIGHT);
|
||||
}
|
||||
|
||||
static int gameDialogHrArtYOffset()
|
||||
{
|
||||
return gameDialogUseHrArt ? 5 : 0;
|
||||
}
|
||||
|
||||
static Rect gameDialogGetBackgroundRect(int index)
|
||||
{
|
||||
Rect rect = _backgrndRects[index];
|
||||
int yOffset = gameDialogHrArtYOffset();
|
||||
rect.top += yOffset;
|
||||
rect.bottom += yOffset;
|
||||
return rect;
|
||||
}
|
||||
|
||||
static int gameDialogGetBackgroundWindowY()
|
||||
{
|
||||
// center onplay area if large enough, else center on screen
|
||||
int visibleHeight = screenGetVisibleHeight();
|
||||
if (visibleHeight >= GAME_DIALOG_WINDOW_HEIGHT) {
|
||||
return (visibleHeight - GAME_DIALOG_WINDOW_HEIGHT) / 2;
|
||||
}
|
||||
|
||||
return (screenGetHeight() - GAME_DIALOG_WINDOW_HEIGHT) / 2;
|
||||
}
|
||||
|
||||
// 0x5187C8
|
||||
static bool _talk_need_to_center = true;
|
||||
|
||||
@@ -2494,31 +2527,35 @@ int _gdCreateHeadWindow()
|
||||
int windowWidth = GAME_DIALOG_WINDOW_WIDTH;
|
||||
|
||||
// NOTE: Uninline.
|
||||
talk_to_create_background_window();
|
||||
gameDialogWindowRenderBackground();
|
||||
if (talk_to_create_background_window() == -1 || gameDialogWindowRenderBackground() == -1) {
|
||||
_gdDestroyHeadWindow();
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned char* buf = windowGetBuffer(gGameDialogBackgroundWindow);
|
||||
ConstBuffer2D backgroundBuf = windowGetBuffer2D(gGameDialogBackgroundWindow);
|
||||
|
||||
for (int index = 0; index < 8; index++) {
|
||||
soundContinueAll();
|
||||
|
||||
Rect* rect = &(_backgrndRects[index]);
|
||||
int width = rect->right - rect->left;
|
||||
int height = rect->bottom - rect->top;
|
||||
Rect rect = gameDialogGetBackgroundRect(index);
|
||||
int width = rect.right - rect.left;
|
||||
int height = rect.bottom - rect.top;
|
||||
_backgrndBufs[index] = (unsigned char*)internal_malloc(width * height);
|
||||
if (_backgrndBufs[index] == nullptr) {
|
||||
_gdDestroyHeadWindow();
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned char* src = buf;
|
||||
src += windowWidth * rect->top + rect->left;
|
||||
|
||||
blitBufferToBuffer(src, width, height, windowWidth, _backgrndBufs[index], width);
|
||||
Buffer2D savedBackgroundBuf { _backgrndBufs[index], width, height };
|
||||
blitBuffer2D(backgroundBuf, rect.left, rect.top, width, height, savedBackgroundBuf);
|
||||
}
|
||||
|
||||
_gdialog_window_create();
|
||||
if (_gdialog_window_create() == -1) {
|
||||
_gdDestroyHeadWindow();
|
||||
return -1;
|
||||
}
|
||||
|
||||
gGameDialogDisplayBuffer = windowGetBuffer(gGameDialogBackgroundWindow) + windowWidth * 14 + 126;
|
||||
gGameDialogDisplayBuffer = windowGetBuffer(gGameDialogBackgroundWindow) + windowWidth * (14 + gameDialogHrArtYOffset()) + 126;
|
||||
|
||||
// TODO: jnz at 0x447275 without cmp or test, not sure what that means.
|
||||
if (false) {
|
||||
@@ -2547,10 +2584,12 @@ void _gdDestroyHeadWindow()
|
||||
gGameDialogBackgroundWindow = -1;
|
||||
}
|
||||
|
||||
gameDialogUseHrArt = false;
|
||||
gExpandedBarterEnabled = false;
|
||||
|
||||
for (int index = 0; index < 8; index++) {
|
||||
internal_free(_backgrndBufs[index]);
|
||||
_backgrndBufs[index] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4551,13 +4590,14 @@ static const char* expandedBarterFrmName()
|
||||
// 0x44AAD8
|
||||
static int talk_to_create_background_window()
|
||||
{
|
||||
gameDialogUseHrArt = false;
|
||||
|
||||
gExpandedBarterEnabled = settings.ui.expand_barter_window
|
||||
&& screenGetHeight() >= GAME_DIALOG_WINDOW_HEIGHT + kExpandedBarterExtraHeight
|
||||
&& FrmImage().lock(OBJ_TYPE_INTERFACE, expandedBarterFrmName());
|
||||
|
||||
int backgroundWindowX = (screenGetWidth() - GAME_DIALOG_WINDOW_WIDTH) / 2;
|
||||
int effectiveBgHeight = GAME_DIALOG_WINDOW_HEIGHT + (gExpandedBarterEnabled ? kExpandedBarterExtraHeight : 0);
|
||||
int backgroundWindowY = (screenGetHeight() - effectiveBgHeight) / 2;
|
||||
int backgroundWindowY = gameDialogGetBackgroundWindowY();
|
||||
|
||||
gGameDialogBackgroundWindow = windowCreate(backgroundWindowX,
|
||||
backgroundWindowY,
|
||||
@@ -4577,15 +4617,29 @@ static int talk_to_create_background_window()
|
||||
int gameDialogWindowRenderBackground()
|
||||
{
|
||||
FrmImage backgroundFrmImage;
|
||||
// alltlk.frm - dialog screen background
|
||||
int backgroundFid = buildFid(OBJ_TYPE_INTERFACE, 103, 0, 0, 0);
|
||||
if (!backgroundFrmImage.lock(backgroundFid)) {
|
||||
return -1;
|
||||
|
||||
if (gameDialogShouldUseHrArt()) {
|
||||
if (backgroundFrmImage.lock(OBJ_TYPE_INTERFACE, "HR_ALLTLK.frm")
|
||||
&& backgroundFrmImage.getWidth() >= GAME_DIALOG_WINDOW_WIDTH
|
||||
&& backgroundFrmImage.getHeight() >= GAME_DIALOG_WINDOW_HEIGHT) {
|
||||
gameDialogUseHrArt = true;
|
||||
} else {
|
||||
backgroundFrmImage.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
int windowWidth = GAME_DIALOG_WINDOW_WIDTH;
|
||||
unsigned char* windowBuffer = windowGetBuffer(gGameDialogBackgroundWindow);
|
||||
blitBufferToBuffer(backgroundFrmImage.getData(), windowWidth, 480, windowWidth, windowBuffer, windowWidth);
|
||||
if (!backgroundFrmImage.isLocked()) {
|
||||
// alltlk.frm - dialog screen background
|
||||
FrmId backgroundFid(OBJ_TYPE_INTERFACE, 103);
|
||||
if (!backgroundFrmImage.lock(backgroundFid)) {
|
||||
return -1;
|
||||
}
|
||||
gameDialogUseHrArt = false;
|
||||
}
|
||||
|
||||
ConstBuffer2D backgroundFrmBuf = backgroundFrmImage.getBuffer();
|
||||
Buffer2D windowBuf = windowGetBuffer2D(gGameDialogBackgroundWindow);
|
||||
blitBuffer2D(backgroundFrmBuf, 0, 0, GAME_DIALOG_WINDOW_WIDTH, GAME_DIALOG_WINDOW_HEIGHT, windowBuf);
|
||||
|
||||
if (!_dialogue_just_started) {
|
||||
windowRefresh(gGameDialogBackgroundWindow);
|
||||
@@ -4734,11 +4788,13 @@ void gameDialogRenderTalkingHead(Art* headFrm, int frame)
|
||||
GAME_DIALOG_WINDOW_WIDTH);
|
||||
}
|
||||
|
||||
int yOffset = gameDialogHrArtYOffset();
|
||||
|
||||
Rect headRect;
|
||||
headRect.left = 126;
|
||||
headRect.top = 14;
|
||||
headRect.top = 14 + yOffset;
|
||||
headRect.right = 514;
|
||||
headRect.bottom = 214;
|
||||
headRect.bottom = 214 + yOffset;
|
||||
|
||||
unsigned char* dest = windowGetBuffer(gGameDialogBackgroundWindow);
|
||||
|
||||
@@ -4748,7 +4804,7 @@ void gameDialogRenderTalkingHead(Art* headFrm, int frame)
|
||||
_upperHighlightFrmImage.getWidth(),
|
||||
dest,
|
||||
426,
|
||||
15,
|
||||
15 + yOffset,
|
||||
GAME_DIALOG_WINDOW_WIDTH,
|
||||
_light_BlendTable,
|
||||
_light_GrayTable);
|
||||
@@ -4759,20 +4815,20 @@ void gameDialogRenderTalkingHead(Art* headFrm, int frame)
|
||||
_lowerHighlightFrmImage.getWidth(),
|
||||
dest,
|
||||
129,
|
||||
214 - _lowerHighlightFrmImage.getHeight() - 2,
|
||||
214 + yOffset - _lowerHighlightFrmImage.getHeight() - 2,
|
||||
GAME_DIALOG_WINDOW_WIDTH,
|
||||
_dark_BlendTable,
|
||||
_dark_GrayTable);
|
||||
|
||||
for (int index = 0; index < 8; ++index) {
|
||||
Rect* rect = &(_backgrndRects[index]);
|
||||
int width = rect->right - rect->left;
|
||||
Rect rect = gameDialogGetBackgroundRect(index);
|
||||
int width = rect.right - rect.left;
|
||||
|
||||
blitBufferToBufferTrans(_backgrndBufs[index],
|
||||
width,
|
||||
rect->bottom - rect->top,
|
||||
rect.bottom - rect.top,
|
||||
width,
|
||||
dest + GAME_DIALOG_WINDOW_WIDTH * rect->top + rect->left,
|
||||
dest + GAME_DIALOG_WINDOW_WIDTH * rect.top + rect.left,
|
||||
GAME_DIALOG_WINDOW_WIDTH);
|
||||
}
|
||||
|
||||
|
||||
+1
-22
@@ -313,6 +313,7 @@ Object* gGameMouseHexCursor;
|
||||
// 0x596C74
|
||||
static Object* gGameMousePointedObject;
|
||||
|
||||
static int _gmouse_get_click_to_scroll();
|
||||
static void _gmouse_3d_enable_modes();
|
||||
static int gameMouseSetBouncingCursorFid(int fid);
|
||||
static int gameMouseRenderAccuracy(const char* string, int color);
|
||||
@@ -454,15 +455,6 @@ int _gmouse_get_click_to_scroll()
|
||||
return _gmouse_click_to_scroll;
|
||||
}
|
||||
|
||||
// gmouse_set_click_to_scroll
|
||||
void _gmouse_set_click_to_scroll(int value)
|
||||
{
|
||||
if (value != _gmouse_click_to_scroll) {
|
||||
_gmouse_click_to_scroll = value;
|
||||
_gmouse_clicked_on_edge = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 0x44B54C
|
||||
int _gmouse_is_scrolling()
|
||||
{
|
||||
@@ -2391,19 +2383,6 @@ int gameMouseHandleScrolling(int x, int y, int cursor)
|
||||
flags |= SCROLLABLE_S;
|
||||
}
|
||||
|
||||
// Click-to-scroll mode (mapper Alt-Z): only scroll while the left button is held at an
|
||||
// edge. Track this in _gmouse_clicked_on_edge so callers can react (e.g. suppress the
|
||||
// regular 3D cursor update while an edge-click scroll is active).
|
||||
// TODO: reconcile with other site where _gmouse_clicked_on_edge is set to true
|
||||
if (_gmouse_click_to_scroll) {
|
||||
bool atEdge = flags != 0;
|
||||
bool leftHeld = (mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0;
|
||||
_gmouse_clicked_on_edge = atEdge && leftHeld;
|
||||
if (!_gmouse_clicked_on_edge) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int dx = 0;
|
||||
int dy = 0;
|
||||
|
||||
|
||||
@@ -82,8 +82,6 @@ void _gmouse_enable_scrolling();
|
||||
void _gmouse_disable_scrolling();
|
||||
bool gmouse_scrolling_is_enabled();
|
||||
int _gmouse_is_scrolling();
|
||||
int _gmouse_get_click_to_scroll();
|
||||
void _gmouse_set_click_to_scroll(int value);
|
||||
void gameMouseRefresh();
|
||||
void _gmouse_handle_event(int mouseX, int mouseY, int mouseState);
|
||||
int gameMouseSetCursor(int cursor);
|
||||
|
||||
+23
-10
@@ -330,7 +330,7 @@ static void inventoryDrawCenteredText(unsigned char* buffer, int pitch, int widt
|
||||
static void inventoryExamineItem(Object* critter, Object* item);
|
||||
static void inventorySetLeftPaneCritter(Object* critter, Object* target, int inventoryWindowType);
|
||||
static void inventoryWindowOpenContextMenu(int eventCode, int inventoryWindowType);
|
||||
static InventoryMoveResult _move_inventory(Object* item, int slotIndex, Object* targetObj, bool isPlanting);
|
||||
static InventoryMoveResult _move_inventory(Object* item, int slotIndex, Object* targetObj, bool isPlanting, int* stealXpOverridePtr);
|
||||
static std::pair<int, int> barterComputeTablesValue(Object* dude, Object* npc, bool offerButton = false);
|
||||
static std::pair<int, int> barterComputeTablesWeight(Object* dude, Object* npc);
|
||||
static int barterAttemptTransaction(Object* dude, Object* offerTable, Object* npc, Object* barterTable);
|
||||
@@ -4622,11 +4622,12 @@ int inventoryOpenLooting(Object* looter, Object* target)
|
||||
_gStealSize += itemGetSize(_stack[_curr_stack]);
|
||||
|
||||
InventoryItem* inventoryItem = &(_pud->items[_pud->length - (slotIndex + _stack_offset[_curr_stack] + 1)]);
|
||||
InventoryMoveResult rc = _move_inventory(inventoryItem->item, slotIndex, _target_stack[_target_curr_stack], true);
|
||||
int stealXpOverride = -1;
|
||||
InventoryMoveResult rc = _move_inventory(inventoryItem->item, slotIndex, _target_stack[_target_curr_stack], true, &stealXpOverride);
|
||||
if (rc == INVENTORY_MOVE_RESULT_CAUGHT_STEALING) {
|
||||
isCaughtStealing = true;
|
||||
} else if (rc == INVENTORY_MOVE_RESULT_SUCCESS) {
|
||||
stealingXp += stealingXpBonus;
|
||||
stealingXp += stealXpOverride >= 0 ? stealXpOverride : stealingXpBonus;
|
||||
stealingXpBonus += 10;
|
||||
}
|
||||
|
||||
@@ -4646,11 +4647,12 @@ int inventoryOpenLooting(Object* looter, Object* target)
|
||||
_gStealSize += itemGetSize(_stack[_curr_stack]);
|
||||
|
||||
InventoryItem* inventoryItem = &(_target_pud->items[_target_pud->length - (slotIndex + _target_stack_offset[_target_curr_stack] + 1)]);
|
||||
InventoryMoveResult rc = _move_inventory(inventoryItem->item, slotIndex, _target_stack[_target_curr_stack], false);
|
||||
int stealXpOverride = -1;
|
||||
InventoryMoveResult rc = _move_inventory(inventoryItem->item, slotIndex, _target_stack[_target_curr_stack], false, &stealXpOverride);
|
||||
if (rc == INVENTORY_MOVE_RESULT_CAUGHT_STEALING) {
|
||||
isCaughtStealing = true;
|
||||
} else if (rc == INVENTORY_MOVE_RESULT_SUCCESS) {
|
||||
stealingXp += stealingXpBonus;
|
||||
stealingXp += stealXpOverride >= 0 ? stealXpOverride : stealingXpBonus;
|
||||
stealingXpBonus += 10;
|
||||
}
|
||||
|
||||
@@ -4764,8 +4766,11 @@ int inventoryOpenStealing(Object* thief, Object* target)
|
||||
|
||||
// 0x474708
|
||||
// note: this is looting and stealing, not the inventory screen
|
||||
static InventoryMoveResult _move_inventory(Object* item, int slotIndex, Object* targetObj, bool isPlanting)
|
||||
static InventoryMoveResult _move_inventory(Object* item, int slotIndex, Object* targetObj, bool isPlanting, int* stealXpOverridePtr)
|
||||
{
|
||||
assert(stealXpOverridePtr != nullptr);
|
||||
*stealXpOverridePtr = -1;
|
||||
|
||||
bool needRefresh = true;
|
||||
|
||||
Rect rect;
|
||||
@@ -4827,13 +4832,17 @@ static InventoryMoveResult _move_inventory(Object* item, int slotIndex, Object*
|
||||
}
|
||||
|
||||
if (quantityToMove != -1) {
|
||||
bool skipMove = false;
|
||||
if (_gIsSteal && _inven_dude == gDude) {
|
||||
if (skillsPerformStealing(_inven_dude, targetObj, item, true) == 0) {
|
||||
SkillStealResult stealResult = skillsPerformStealing(_inven_dude, targetObj, item, quantityToMove, true, stealXpOverridePtr);
|
||||
if (stealResult == SkillStealResult::caught) {
|
||||
result = INVENTORY_MOVE_RESULT_CAUGHT_STEALING;
|
||||
} else if (stealResult == SkillStealResult::fail) {
|
||||
skipMove = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != INVENTORY_MOVE_RESULT_CAUGHT_STEALING) {
|
||||
if (!skipMove && result != INVENTORY_MOVE_RESULT_CAUGHT_STEALING) {
|
||||
if (itemMove(_inven_dude, targetObj, item, quantityToMove) != -1) {
|
||||
result = INVENTORY_MOVE_RESULT_SUCCESS;
|
||||
} else {
|
||||
@@ -4854,13 +4863,17 @@ static InventoryMoveResult _move_inventory(Object* item, int slotIndex, Object*
|
||||
}
|
||||
|
||||
if (quantityToMove != -1) {
|
||||
bool skipMove = false;
|
||||
if (_gIsSteal && _inven_dude == gDude) {
|
||||
if (skillsPerformStealing(_inven_dude, targetObj, item, false) == 0) {
|
||||
SkillStealResult stealResult = skillsPerformStealing(_inven_dude, targetObj, item, quantityToMove, false, stealXpOverridePtr);
|
||||
if (stealResult == SkillStealResult::caught) {
|
||||
result = INVENTORY_MOVE_RESULT_CAUGHT_STEALING;
|
||||
} else if (stealResult == SkillStealResult::fail) {
|
||||
skipMove = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != INVENTORY_MOVE_RESULT_CAUGHT_STEALING) {
|
||||
if (!skipMove && result != INVENTORY_MOVE_RESULT_CAUGHT_STEALING) {
|
||||
if (itemMove(targetObj, _inven_dude, item, quantityToMove) == 0) {
|
||||
if ((item->flags & OBJECT_IN_RIGHT_HAND) != 0) {
|
||||
targetObj->fid = buildFid(FID_TYPE(targetObj->fid), targetObj->fid & 0xFFF, FID_ANIM_TYPE(targetObj->fid), 0, targetObj->rotation + 1);
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ static char _aErrorF2[] = "ERROR! F2";
|
||||
static IsoWindowRefreshProc* _map_scroll_refresh = isoWindowRefreshRectGame;
|
||||
|
||||
// 0x519544
|
||||
const int _map_data_elev_flags[ELEVATION_COUNT] = {
|
||||
static const int _map_data_elev_flags[ELEVATION_COUNT] = {
|
||||
2,
|
||||
4,
|
||||
8,
|
||||
|
||||
@@ -77,7 +77,6 @@ extern int gElevation;
|
||||
extern MessageList gMapMessageList;
|
||||
extern MapHeader gMapHeader;
|
||||
extern TileData* _square[ELEVATION_COUNT];
|
||||
extern const int _map_data_elev_flags[ELEVATION_COUNT];
|
||||
extern int gIsoWindow;
|
||||
|
||||
int isoInit();
|
||||
|
||||
+70
-881
File diff suppressed because it is too large
Load Diff
@@ -17,8 +17,8 @@ bool map_toggle_block_obj_viewing_on();
|
||||
|
||||
void map_load_dialog();
|
||||
void map_save_dialog();
|
||||
int map_save_as(const char* name);
|
||||
void map_get_name(char* buf);
|
||||
void map_save_as();
|
||||
void map_info_dialog();
|
||||
void create_spray_tool();
|
||||
void copy_spray_tile();
|
||||
// mode = 1 - enable, 0 - disable, -1 - toggle
|
||||
@@ -32,9 +32,7 @@ int pickHex();
|
||||
int pickToolbar(int topY);
|
||||
void placeObject(int pid, int fid);
|
||||
void placeTile(int pid, int fid);
|
||||
// Pass the current toolbar type to filter the region copy by type, or -1 to copy all object
|
||||
// types in the picked region (mirrors the original mapper's `copy_object(arg1)` arg).
|
||||
void copyObject(int filterType);
|
||||
void copyObject();
|
||||
void copyTile();
|
||||
void eraseObject();
|
||||
|
||||
|
||||
+211
-448
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,6 @@ extern unsigned char e_num[4][19 * 26];
|
||||
int mapper_main(int argc, char** argv);
|
||||
void print_toolbar_name(int object_type);
|
||||
int mapper_inven_unwield(Object* obj, int right_hand);
|
||||
void mapperShowTimedMsg(const char* msg);
|
||||
bool mapperYesNoDialog(const char* msg);
|
||||
|
||||
} // namespace fallout
|
||||
|
||||
|
||||
@@ -615,13 +615,6 @@ int proto_build_all_type(int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int proto_build_all_type_binary(int type)
|
||||
{
|
||||
// TODO: rebuild binary proto list for given object type.
|
||||
(void)type;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int protoEdit(int protoId)
|
||||
{
|
||||
// TODO: implement proto editor dialog — load proto, show editor UI
|
||||
@@ -629,26 +622,6 @@ int protoEdit(int protoId)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void rebuild_spray_tools()
|
||||
{
|
||||
// TODO: rebuild spray tool (create/update pattern protos)
|
||||
}
|
||||
|
||||
void rebuild_binary()
|
||||
{
|
||||
// TODO: rebuild binary proto files from text sources
|
||||
}
|
||||
|
||||
void art_to_protos()
|
||||
{
|
||||
// TODO: create new proto entries for art files that have no proto yet
|
||||
}
|
||||
|
||||
void swap_protos()
|
||||
{
|
||||
// TODO: swap two prototype slots
|
||||
}
|
||||
|
||||
static unsigned char itemIconsBgColor()
|
||||
{
|
||||
return _colorTable[21];
|
||||
|
||||
@@ -16,11 +16,6 @@ void init_mapper_protos();
|
||||
const char* proto_wall_light_str(int flags);
|
||||
int proto_pick_ai_packet(int* value);
|
||||
int proto_build_all_type(int type);
|
||||
int proto_build_all_type_binary(int type);
|
||||
void rebuild_spray_tools();
|
||||
void rebuild_binary();
|
||||
void art_to_protos();
|
||||
void swap_protos();
|
||||
int protoEdit(int protoId);
|
||||
int protoChooseMultiPids(int pidType, protoChooseFidCallback fidFunc, protoChooseAddCallback addFunc);
|
||||
// protoInstEdit moved to mp_instance.h
|
||||
|
||||
+5
-19
@@ -330,26 +330,12 @@ int map_scr_add_spatial(int tile, int elevation)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void map_set_script(int scriptIndex)
|
||||
void map_set_script()
|
||||
{
|
||||
if (scriptIndex == -1) {
|
||||
if (gMapSid != -1) {
|
||||
scriptRemove(gMapSid);
|
||||
gMapSid = -1;
|
||||
}
|
||||
gMapHeader.scriptIndex = -1;
|
||||
} else {
|
||||
int idx = scriptIndex - 1;
|
||||
if (gMapSid == -1) {
|
||||
scriptAdd(&gMapSid, SCRIPT_TYPE_SYSTEM);
|
||||
}
|
||||
Script* script;
|
||||
if (scriptGetScript(gMapSid, &script) != -1) {
|
||||
script->index = idx;
|
||||
gMapHeader.scriptIndex = idx;
|
||||
_scr_find_str_run_info(idx, nullptr, gMapSid);
|
||||
}
|
||||
}
|
||||
char info[256];
|
||||
snprintf(info, sizeof(info), "Map SID: %d", gMapSid);
|
||||
_win_msg(info, 80, 80, 0x10104);
|
||||
// TODO: full script selection dialog
|
||||
}
|
||||
|
||||
void map_show_script()
|
||||
|
||||
@@ -8,7 +8,7 @@ int map_scr_remove_all_spatials();
|
||||
|
||||
int map_scr_add_spatial(int tile, int elevation);
|
||||
void map_scr_toggle_hexes();
|
||||
void map_set_script(int scriptIndex);
|
||||
void map_set_script();
|
||||
void map_show_script();
|
||||
void scr_debug_print_scripts();
|
||||
int scr_choose(int scriptType);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user