REO-EE/_module/nss/cbt_weap_inc.nss
Jaysyn904 f82740bbbd Initial commit
Initial commit
2024-02-22 13:22:03 -05:00

53 lines
2.2 KiB
Plaintext

/*******************************************************************************
Script : cbt_ovr_weap_inc
Name : Combat Override Attack Include
Purpose : include script for combat override system (attack functions)
Author : Quixsilver
Modified : May 30, 2010
This file is licensed under the terms of the
GNU GENERAL PUBLIC LICENSE (GPL) Version 2
*******************************************************************************/
/******************************** INCLUDES ************************************/
/******************************** CONSTANTS ***********************************/
const string CBT_OVR_SVAR_WEAPON_DAMAGE = "WEAPON_DAMAGE";
const string CBT_OVR_SVAR_WEAPON_DAMAGE_POWER = "WEAPON_DAMAGE_POWER";
const string CBT_OVR_SVAR_WEAPON_ARMOR_PENETRATION = "WEAPON_PENETRATION";
const string CBT_OVR_SVAR_AMMO_DAMAGE = "AMMO_DAMAGE";
const string CBT_OVR_SVAR_AMMO_DAMAGE_TYPE = "AMMO_DAMAGE_TYPE";
const string CBT_OVR_SVAR_AMMO_ARMOR_PENETRATION = "AMMO_PENETRATION";
/******************************** VARIABLES ***********************************/
struct WeaponDamageStruct
{
int DamageType;
int DamagePower;
int Damage;
int ArmorPenetration;
};
/*************************** FUNCTION PROTOTYPES ******************************/
// Gets oWeapon's damage struct
// - WeaponDamageStruct variable:
// DamageType (DAMAGE_TYPE_*)
// DamagePower (DAMAGE_POWER_*)
// Damage (integer)
// ArmorPenetration (integer)
struct WeaponDamageStruct GetWeaponDamage(object oWeapon);
/************************* FUNCTION IMPLEMENTATION ****************************/
struct WeaponDamageStruct GetWeaponDamage(object oWeapon)
{
struct WeaponDamageStruct WeaponDamage;
// testing values
WeaponDamage.DamageType = DAMAGE_TYPE_PIERCING;
WeaponDamage.DamagePower = DAMAGE_POWER_PLUS_TWENTY;
WeaponDamage.Damage = GetLocalInt(oWeapon, CBT_OVR_SVAR_WEAPON_DAMAGE) +
GetLocalInt(oWeapon, CBT_OVR_SVAR_AMMO_DAMAGE);
WeaponDamage.ArmorPenetration = GetLocalInt(oWeapon, CBT_OVR_SVAR_WEAPON_ARMOR_PENETRATION) +
GetLocalInt(oWeapon, CBT_OVR_SVAR_AMMO_ARMOR_PENETRATION);
return WeaponDamage;
}