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

// This sprite script is for the item corresponding to the Chicken Garand weapon.;

// If true, the sprite will be placed on the ground after being created.;
placeOnGround = false;

// Init is the main sprite-creation command.  It requires some commands to be called before it and others after it.;
// definition: Init(Sprite scale vector(scale x, scale y, scale z), material, movement type, collision type, destructible type, activation type);
// It's possible to randomly choose a material by adding multiple ones separated by ':'.  Example: 15:BlueChickenMaterial:33:PotatoMaterial;
// Movement types;
// 0 : No movement (but can be moved);
// 1 : Projectile;
// 2 : Enemy;
// 3 : Static (cannot be moved at all);
// 4 : Physics (bouncing);
// Collision types;
// 0 : No collisions;
// 1 : The flat mesh has collisions;
// 2 : The capsule shape around the sprite has collisions;
// 3 : Overlap (don't use);
// Destruction types;
// 0 : Can't be destroyed;
// 1 : Disappears on destruction;
// 2 : Explodes (not used, becomes 1);
// 3 : Slice (not used, becomes 1);
// 4 : Falls down like a flat mesh;
// 5 : Context (depends on how the destruction happened.  Mostly for enemies);
// Activation types;
// 0 : Can't be activated;
// 1 : Can only be activated once;
// 2 : Can be activated infinitely;
// 3 : This is a switch;
Init(vector(1.2,1.2,1.2), itemChickenGarandMaterial, 0, 2, 1, 0);

// AI is a subject on its own. Please check the AI section in the modding documentation at https://blazingbitgames.com/mods ;
// This calls the ADD_POTENTIAL_SECRET_ITEM AI command.;
ai.AddNode(364, -1.0, -1.0, 0);

// This calls the KILL_IF_CLOSE AI command which starts after 0.5 seconds and stays active.;
ai.AddNode(2, 0.5, -1.0, 3, 100.0, 0.0, 0.0);

// This calls the FOLLOW_PLAYER AI command which starts after 0.5 seconds and stays active.;
ai.AddNode(0, 0.5, -1.0, 5, 250.0, 0.0, 200.0, -1.0, 0.0);

// Once killed by KILL_IF_CLOSE, will call the PICKUP_WEAPON AI command and give the player the corresponding weapon to this sprite.;
ai.AddDeathNode(10, 0);

// Set what to do when colliding with an object of any type;
// Collision responses;
// 0 : Ignore;
// 2 : Block;
capsule.CollisionResponseToAllChannels = 0;

// Set what to do when colliding with an object of type 0;
// Possible collision types;
// 0 : Static (walls or static sprites);
// 1 : Dynamic (most moving sprites);
// 2 : Pawn (the player);
// 6 : Usually for projectiles that can pass through most objects;
// 7 : Most projectiles;
// 14 : The player in multiplayer;
capsule.SetCollisionResponseToChannel(0, 2);

// Set the type of collision of this sprite's capsule.  This affects how it'll react with other objects it can collide with.;
capsule.CollisionObjectType = 7;

// This command will add a light to the sprite.;
AddLight();
// Set the color of the light (red, green, blue).  The light color will be overriden by the game according to the weapon's rarity.;
lightColor = vector(1.0, 1.0, 1.0);
// Set how far the light goes.;
light.LightFunctionFadeDistance = 50.0;
// Set to true for the light to cast shadows.;
light.CastShadows = false;
// Set how fast the brightness of the light falls.;
light.LightFalloffExponent = 40.0;
// Set the base brightness of the light.;
light.Intensity = 15.0;