Skip to content
Open
Changes from all 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
22 changes: 22 additions & 0 deletions code/scripting/api/objs/weaponclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,28 @@ ADE_VIRTVAR(Bomb, l_Weaponclass, "boolean", "Is weapon class flagged as bomb", "
return ADE_RETURN_FALSE;
}

ADE_VIRTVAR(Puncture, l_Weaponclass, "boolean", "Is weapon class flagged as puncture", "boolean", "New flag")
{
int idx;
if(!ade_get_args(L, "o", l_Weaponclass.Get(&idx)))
return ADE_RETURN_FALSE;

if(idx < 0 || idx >= weapon_info_size())
return ADE_RETURN_FALSE;

weapon_info *info = &Weapon_info[idx];

if(ADE_SETTING_VAR)
{
LuaError(L, "Setting Puncture flag is not supported");
}

if (info->wi_flags[Weapon::Info_Flags::Puncture])
return ADE_RETURN_TRUE;
else
return ADE_RETURN_FALSE;
}

ADE_VIRTVAR(CustomData, l_Weaponclass, nullptr, "Gets the custom data table for this weapon class", "table", "The weapon class's custom data table")
{
int idx;
Expand Down
Loading