// Every script operation must end with a semicolon.  Spaces or line returns are ignored.;
// Base game weapon file names are a number, so only use non-number names to add new weapons.  Ex: ChickenGarand.txt;
// Don't put spaces in file names.;
// This file contains only a small subset of all possible weapons commands.  To make your own weapon, take a similar existing one and copy its script file.;

// This weapon script overwrites the SAWED_OFF and makes it look and work like the SMART_GUN.;

// The damage players get if the weapon is blood ammo.;
bloodAmmoDamage = 1;

// How far the sound of firing this weapon goes in cubes.  Wakes up enemies.;
soundRange = 20.0;

// The sound to play when firing.;
fireSound.m_sound = 657;
fireSound.m_pitchMin = 0.9;
fireSound.m_pitchMax = 1.1;

// The sound to play when there's no more ammo.;
noAmmoSound.m_sound = 23;

// Unused!
genericGunIdle = true;

// The sound to play when reloading;
reloadSound.m_sound = 658;
reloadSound.m_pitchMin = 0.9;
reloadSound.m_pitchMax = 1.1;

// Spawns the projectiles a bit lower and angles them slightly up.  Improves visibility for weapons with large projectiles.;
offsetProjectile = true;

// Projectiles are fired towards the closest valid target.;
homing = true;

// If true, the weapon will still attack if pressing and holding the attack button while the previous attack is still ongoing.;
forceFireEnabled = true;

// The velocity at which to eject the magazine.;
magazineVel = 3000.0;

// Delay before the magazine is ejected.;
magazineTimeFirst = 0.33;

// The sprite ID of the magazine sprite.;
magazineType = 1207;

// Definition: Init(texture, normalTexture, emissiveTexture, itemTexture, fireRate, damage, automatic, recoil, name, level);
// To add a space to the name, use the code: %20 ;
Init("/Game/FirstPerson/Textures/fpsSmartGun", "/Game/FirstPerson/Textures/fpsSmartGunNormal", "/Game/FirstPerson/Textures/fpsSmartGunEmissive",
"/Game/FirstPerson/Textures/itemSmartGun", 0.125, 10, true, 1.0, "SAWED%20OFF", 1);
// Set the dirty/bloody texture.;
dirtyTexture="/Game/FirstPerson/Textures/fpsSmartGun_Sp";
// Definition: InitBulletWeapon(ammoType, ammoConsumption, magazineSize, reloadTime, ammoToAddPerReload, bulletVelocity, bulletsPerShot, casingsPerShot, casingsOnReload, casingSpriteID, bulletSpriteID);
InitBulletWeapon(0, 1, 50, 0.5, 50, 14000.0, 1, 0, false, -1, 1204);

// AddPotentialStats determines which modifier/stat the weapon can have when of a higher rarity.;
// For help choosing potential stats in script, take the list below and remove the stat IDs that the weapon can't support.;
//AddPotentialStats(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29);
AddPotentialStats(0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29);

// All animation init functions have this definition: (offset, frameAmount, duration, clamp);
// If one of these values contains a = or a ?, it means that the value to use can be different depending on a condition.;
// The format of conditions is this: X=Y?V:W , which translates to: if condition X equals Y use V and if not use W.;
// The possible conditions:;
// 0 : MAGAZINE : magazine size at the time of doing the animation;
// 1 : PREV_MAGAZINE : magazine size it had before doing the animation;
// 2 : MAIN_MAGAZINE : magazine of the main weapon instead of our own when using alternate fire modes.;
// 3 : NONE : Don't use a condition if you're going to set that...;
// Set the start firing animation to frame 2, with 2 frames, no end to the duration and clamp the animation.;
InitStartFiringAnim(2, 2, -1.0, true);

// Set the stop firing animation to frame 0, with 2 frames, with a 3 seconds looping animation.;
InitStopFiringAnim(0, 2, 3.0, false);

// Set the reload animation to frame 4, with 10 frames, no end to the duration and clamp the animation.;
InitReloadAnim(4, 10, -1.0, true);

// This declares that the primary fire settings of this weapon are done and we're now adding an alternate fire mode.;
// In this case, it's a different projectile attack that launches a turret-spawning sprite.;
[secondary]

bloodAmmoDamage = 4;
soundRange = 5.0;
fireSound.m_sound = 658;
fireSound.m_pitchMin = 0.9;
fireSound.m_pitchMax = 1.1;
reloadSound.m_sound = 658;
reloadSound.m_pitchMin = 0.9;
reloadSound.m_pitchMax = 1.1;
noAmmoSound.m_sound = 23;
genericGunIdle = true;

offsetProjectile = true;

// If true, if the weapon has a charge time, the charging won't require holding the firing button and it can't be cancelled.;
holdCharge = false;

// If true, the weapon will "uncharge" after firing once.;
stopAfterShootAtMaxCharge = true;

// If true, the weapon will hold the charge until the player releases the fire button which will trigger firing.;
shootOnChargeRelease = false;

forceFireEnabled = true;

Init("/Game/FirstPerson/Textures/fpsSmartGun", "/Game/FirstPerson/Textures/fpsSmartGunNormal", "/Game/FirstPerson/Textures/fpsSmartGunEmissive",
"/Game/FirstPerson/Textures/itemSmartGun", 0.25, 10, true, 1.0, "SAWED%20OFF", 1);
dirtyTexture="/Game/FirstPerson/Textures/fpsSmartGun_Sp";
InitBulletWeapon(0, 50, 1000, 1.0, 50, 3000.0, 1, 0, false, -1, 1206);
// Definition: InitCharge(chargeTime, minChargeTime, chargeDamage, chargeLength, chargeAngle, chargeVelocity, shootAtMaxCharge, chargeExplosion);
// chargeTime: the amount of time it takes to reach max charge.;
// minChargeTime: The minimum amount of time of charging required to be able to fire the weapon.;
// chargeDamage: The damage the weapon does at max charge.  It can be the same as the normal damage.;
// chargeLength: The range of melee and beam attacks at max charge.  It can be the same as the normal value.;
// chargeAngle: The angle of the slash of a melee attack at max charge.  It can be the same as the normal value.;
// chargeVelocity: The velocity of the projectile at max charge.  It can be the same as the normal value.;
// shootAtMaxCharge: If true, will shoot the weapon automatically when reaching max charge.;
// chargeExplosion: If true, will increase the size and damage of projectile explosions depending on charge level.;
InitCharge(0.25, 0.25, 10, 0.0, 0.0, false, true, false);

AddPotentialStats(0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28);

InitStartFiringAnim(10, 4, -1.0, true);
InitStopFiringAnim(0, 2, 3.0, false);
InitChargeAnim(4, 6, -1.0, true);
