Skip to content

Damaged Wall #3827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions config/fxdata/slabset.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8143,4 +8143,117 @@ Objects = []

[slab59.SE]
Columns = [365, 365, 365, 365, 365, 365, 365, 365, 365]
Objects = []

[slab60]
[slab60.S]
Columns = [2, 2, 2, 2, 817, 2, 209, 210, 211]
Objects = []

[slab60.W]
Columns = [209, 2, 2, 210, 817, 2, 211, 2, 2]
Objects = []

[slab60.N]
Columns = [209, 210, 211, 2, 817, 2, 2, 2, 2]
Objects = []

[slab60.E]
Columns = [2, 2, 209, 2, 817, 210, 2, 2, 211]
Objects = []

[slab60.SW]
Columns = [209, 2, 2, 210, 817, 2, 5, 210, 211]
Objects = []

[slab60.NW]
Columns = [5, 210, 211, 210, 817, 2, 211, 2, 2]
Objects = []

[slab60.NE]
Columns = [209, 210, 5, 2, 817, 210, 2, 2, 211]
Objects = []

[slab60.SE]
Columns = [2, 2, 209, 2, 817, 210, 209, 210, 5]
Objects = []

[slab60.ALL]
Columns = [5, 210, 5, 210, 817, 210, 5, 210, 5]
Objects = []

[slab60.S_LAVA]
Columns = [2, 2, 2, 2, 817, 2, 212, 213, 214]
Objects = []

[slab60.W_LAVA]
Columns = [212, 2, 2, 213, 817, 2, 214, 2, 2]
Objects = []

[slab60.N_LAVA]
Columns = [212, 213, 214, 2, 817, 2, 2, 2, 2]
Objects = []

[slab60.E_LAVA]
Columns = [2, 2, 212, 2, 817, 213, 2, 2, 214]
Objects = []

[slab60.SW_LAVA]
Columns = [212, 2, 2, 213, 817, 2, 38, 213, 214]
Objects = []

[slab60.NW_LAVA]
Columns = [38, 213, 214, 213, 817, 2, 214, 2, 2]
Objects = []

[slab60.NE_LAVA]
Columns = [212, 213, 38, 2, 817, 213, 2, 2, 214]
Objects = []

[slab60.SE_LAVA]
Columns = [2, 2, 212, 2, 817, 213, 212, 213, 38]
Objects = []

[slab60.ALL_LAVA]
Columns = [38, 213, 38, 213, 817, 213, 38, 213, 38]
Objects = []

[slab60.S_WATER]
Columns = [2, 2, 2, 2, 817, 2, 59, 59, 59]
Objects = []

[slab60.W_WATER]
Columns = [59, 2, 2, 59, 817, 2, 59, 2, 2]
Objects = []

[slab60.N_WATER]
Columns = [59, 59, 59, 2, 817, 2, 2, 2, 2]
Objects = []

[slab60.E_WATER]
Columns = [2, 2, 59, 2, 817, 59, 2, 2, 59]
Objects = []

[slab60.SW_WATER]
Columns = [25, 2, 2, 36, 817, 2, 29, 34, 25]
Objects = []

[slab60.NW_WATER]
Columns = [29, 34, 25, 34, 817, 2, 25, 2, 2]
Objects = []

[slab60.NE_WATER]
Columns = [25, 36, 29, 2, 817, 34, 2, 2, 25]
Objects = []

[slab60.SE_WATER]
Columns = [2, 2, 25, 2, 817, 36, 25, 36, 29]
Objects = []

[slab60.ALL_WATER]
Columns = [29, 25, 29, 25, 817, 25, 29, 25, 29]
Objects = []

[slab60.CENTER]
Columns = [2, 2, 2, 2, 817, 2, 2, 2, 2]
Objects = []
31 changes: 27 additions & 4 deletions config/fxdata/terrain.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; KeeperFX Terrain Configuration file version 1.0.

[common]
SlabsCount = 60
SlabsCount = 61
RoomsCount = 17

; Slabs configuration.
Expand Down Expand Up @@ -184,11 +184,11 @@ IsOwnable = 1
WlbType = 0

[slab9]
Name = DAMAGED_WALL
TooltipTextID = 330
Name = BLANK_WALL
TooltipTextID = 329
BlockFlagsHeight = 4
BlockHealthIndex = 2
BlockFlags = BLOCKING DIGGABLE
BlockFlags = BLOCKING FILLED
NoBlockFlags =
FillStyle = 0
Category = 3
Expand Down Expand Up @@ -1069,6 +1069,28 @@ IsDiggable = 0
IsOwnable = 1
WlbType = 0

[slab60]
Name = DAMAGED_WALL
TooltipTextID = 330
BlockFlagsHeight = 4
BlockHealthIndex = 9
BlockFlags = BLOCKING FILLED
NoBlockFlags =
FillStyle = 0
Category = 3
SlbID = 0
Indestructible = 0
Wibble = 1
Animated = 0
IsSafeLand = 0
IsDiggable = 1
IsOwnable = 1
WlbType = 0
HealthLoss = 5
DamageTurns = 500
TurnTo = 10
TransformEffect = EFFECT_DIRT_RUBBLE 1

; Rooms configuration.

[room0]
Expand Down Expand Up @@ -1429,3 +1451,4 @@ DOOR_WOODEN = 20
DOOR_BRACE = 80
DOOR_STEEL = 255
DOOR_MAGIC = 255
DAMAGED = 255
88 changes: 79 additions & 9 deletions src/config_terrain.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ const struct NamedCommand terrain_slab_commands[] = {
{"ANIMATED", 14},
{"ISOWNABLE", 15},
{"INDESTRUCTIBLE", 16},
{"HEALTHLOSS", 17},
{"DAMAGETURNS", 18},
{"TURNTO", 19},
{"TRANSFORMEFFECT", 20},
{NULL, 0},
};

Expand Down Expand Up @@ -214,6 +218,7 @@ const struct NamedCommand terrain_health_commands[] = {
{"DOOR_BRACE", 7},
{"DOOR_STEEL", 8},
{"DOOR_MAGIC", 9},
{"DAMAGED", 10},
{NULL, 0},
};

Expand Down Expand Up @@ -717,6 +722,79 @@ TbBool parse_terrain_slab_blocks(char *buf, long len, const char *config_textnam
COMMAND_TEXT(cmd_num), blocknamelen, blockname, config_textname);
}
break;
case 17: // HEALTHLOSS
if (get_conf_parameter_single(buf,&pos,len,word_buf,sizeof(word_buf)) > 0)
{
k = atoi(word_buf);
if (k > 0)
{
slbattr->health_loss = k;
n++;
}
}
if (n < 1)
{
CONFWRNLOG("Incorrect value of \"%s\" parameter in [%.*s] block of %s file.",
COMMAND_TEXT(cmd_num), blocknamelen, blockname, config_textname);
}
break;
case 18: // DAMAGETURNS
if (get_conf_parameter_single(buf,&pos,len,word_buf,sizeof(word_buf)) > 0)
{
k = atoi(word_buf);
if (k > 0)
{
slbattr->damage_turns = k;
n++;
}
}
if (n < 1)
{
CONFWRNLOG("Incorrect value of \"%s\" parameter in [%.*s] block of %s file.",
COMMAND_TEXT(cmd_num), blocknamelen, blockname, config_textname);
}
break;
case 19: // TURNTO
if (get_conf_parameter_single(buf,&pos,len,word_buf,sizeof(word_buf)) > 0)
{
k = atoi(word_buf);
if (k > 0)
{
slbattr->turn_to = k;
n++;
}
}
if (n < 1)
{
CONFWRNLOG("Incorrect value of \"%s\" parameter in [%.*s] block of %s file.",
COMMAND_TEXT(cmd_num), blocknamelen, blockname, config_textname);
}
break;
case 20: // TRANSFORMEFFECT
if (get_conf_parameter_single(buf,&pos,len,word_buf,sizeof(word_buf)) > 0)
{
k = get_id(effect_desc, word_buf);
if (k >= 0)
{
slbattr->transform_effect = k;
n++;
} else
{
slbattr->transform_effect = 0;
}
}
if (get_conf_parameter_single(buf,&pos,len,word_buf,sizeof(word_buf)) > 0)
{
k = atoi(word_buf);
slbattr->transform_effect_mode = k;
n++;
}
if (n < 2)
{
CONFWRNLOG("Incorrect value of \"%s\" parameters in [%s] block of %s file.",
COMMAND_TEXT(cmd_num),word_buf,config_textname);
}
break;
case ccr_comment:
break;
case ccr_endOfFile:
Expand Down Expand Up @@ -751,15 +829,7 @@ TbBool parse_terrain_slab_blocks(char *buf, long len, const char *config_textnam
n = 0;
switch (cmd_num)
{
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 1 ... HEALTH_BLOCKS:
if (get_conf_parameter_single(buf,&pos,len,word_buf,sizeof(word_buf)) > 0)
{
k = atoi(word_buf);
Expand Down
6 changes: 6 additions & 0 deletions src/config_terrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extern "C" {

#define TERRAIN_ITEMS_MAX 256
#define SLABSETS_PER_SLAB (9*3+1)
#define HEALTH_BLOCKS 10


/******************************************************************************/
Expand Down Expand Up @@ -124,6 +125,11 @@ struct SlabAttr {
unsigned char wlb_type;
unsigned char is_ownable;
unsigned char indestructible;
HitPoints health_loss;
GameTurn damage_turns;
SlabKind turn_to;
ThingModel transform_effect;
TbBool transform_effect_mode;
};

#pragma pack()
Expand Down
Loading