Created
December 25, 2013 19:19
-
-
Save Crystalwarrior/8126080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ============================================================ | |
| // Project : CityRPG | |
| // Author : Iban | |
| // Description : Pickaxe Module Code File | |
| // ============================================================ | |
| // Table of Contents | |
| // 1. Pickaxe | |
| // 1.1. Pickaxe Datablocks | |
| // 1.2. Visual Functionality | |
| // ============================================================ | |
| // ============================================================ | |
| // Section 1 : Datablocks | |
| // ============================================================ | |
| if(!isObject(CityRPGPickaxeItem)) | |
| { | |
| AddDamageType("Pickaxe", '<bitmap:Add-Ons/GameMode_CityRPG/shapes/ci/pickaxe> %1', '%2 <bitmap:Add-Ons/GameMode_CityRPG/shapes/ci/pickaxe> %1', 0.5, 1); | |
| // Section 1.1 : Pickaxe Datablocks | |
| datablock ProjectileData(CityRPGPickaxeProjectile) | |
| { | |
| directDamage = 15; | |
| directDamageType = $DamageType::Pickaxe; | |
| radiusDamageType = $DamageType::Pickaxe; | |
| muzzleVelocity = 50; | |
| velInheritFactor = 1; | |
| armingDelay = 0; | |
| lifetime = 100; | |
| fadeDelay = 70; | |
| bounceElasticity = 0; | |
| bounceFriction = 0; | |
| isBallistic = false; | |
| gravityMod = 0.0; | |
| hasLight = false; | |
| lightRadius = 3.0; | |
| lightColor = "0 0 0.5"; | |
| }; | |
| datablock ItemData(CityRPGPickaxeItem) | |
| { | |
| category = "Weapon"; | |
| className = "Weapon"; | |
| shapeFile = "Add-Ons/GameMode_CityRPG/shapes/pickaxe.2.dts"; | |
| mass = 1; | |
| density = 0.2; | |
| elasticity = 0.2; | |
| friction = 0.6; | |
| emap = true; | |
| uiName = "Pickaxe"; | |
| iconName = "Add-Ons/GameMode_CityRPG/shapes/ItemIcons/pickaxe"; | |
| doColorShift = true; | |
| colorShiftColor = "0.54 0.27 0.07 1"; | |
| image = CityRPGPickaxeImage; | |
| canDrop = true; | |
| // CityRPG Properties | |
| noSpawn = true; | |
| }; | |
| datablock ShapeBaseImageData(CityRPGPickaxeImage) | |
| { | |
| // SpaceCasts | |
| raycastWeaponRange = 4; | |
| raycastWeaponTargets = $TypeMasks::PlayerObjectType | |
| |$TypeMasks::StaticObjectType | |
| |$TypeMasks::TerrainObjectType | |
| |$TypeMasks::VehicleObjectType | |
| |$TypeMasks::FXBrickObjectType; | |
| raycastDirectDamage = 0; | |
| raycastDirectDamageType = $DamageType::Pickaxe; | |
| raycastExplosionProjectile = hammerProjectile; | |
| raycastExplosionSound = hammerHitSound; | |
| shapeFile = "Add-Ons/GameMode_SuburbRPG/shapes/pickaxe.dts"; | |
| emap = true; | |
| mountPoint = 0; | |
| eyeOffset = "0.7 1.2 -0.9"; | |
| offset = "0 0 0"; | |
| correctMuzzleVector = false; | |
| className = "WeaponImage"; | |
| item = CityRPGPickaxeItem; | |
| ammo = " "; | |
| projectile = CityRPGPickaxeProjectile; | |
| projectileType = Projectile; | |
| melee = true; | |
| doRetraction = false; | |
| armReady = true; | |
| doColorShift = true; | |
| colorShiftColor = CityRPGPickaxeItem.colorShiftColor; | |
| stateName[0] = "Activate"; | |
| stateTimeoutValue[0] = 0.5; | |
| stateTransitionOnTimeout[0] = "Ready"; | |
| stateName[1] = "Ready"; | |
| stateTransitionOnTriggerDown[1] = "Fire"; | |
| stateAllowImageChange[1] = true; | |
| stateName[2] = "Fire"; | |
| stateTransitionOnTimeout[2] = "Anim"; | |
| // stateTimeoutValue[2] = 0.2; | |
| stateFire[2] = true; | |
| stateAllowImageChange[2] = false; | |
| stateScript[2] = "onFire"; | |
| stateWaitForTimeout[2] = true; | |
| stateName[3] = "Anim"; | |
| stateSequence[3] = "Fire"; | |
| stateTimeoutValue[3] = 0.3; | |
| stateTransitionOnTimeout[3] = "Delay"; | |
| stateName[4] = "Delay"; | |
| stateTimeoutValue[4] = 0.2; | |
| stateTransitionOnTimeout[4] = "CheckFire"; | |
| stateName[5] = "CheckFire"; | |
| stateTransitionOnTriggerUp[5] = "StopFire"; | |
| stateTransitionOnTriggerDown[5] = "Fire"; | |
| stateName[6] = "StopFire"; | |
| stateTransitionOnTimeout[6] = "Ready"; | |
| // stateTimeoutValue[6] = 0.2; | |
| stateAllowImageChange[6] = false; | |
| stateWaitForTimeout[6] = true; | |
| stateSequence[6] = "StopFire"; | |
| stateScript[6] = "onStopFire"; | |
| }; | |
| } | |
| // Section 1.2 : Visual Functionality | |
| function CityRPGPickaxeImage::onFire(%this, %obj, %slot) | |
| { | |
| %obj.playthread(2, shiftTo); | |
| parent::onFire(%this, %obj, %slot); | |
| } | |
| function CityRPGPickaxeImage::onStopFire(%this, %obj, %slot) | |
| { | |
| // %obj.playthread(2, root); <--Pretty much unnecessary now. | |
| } | |
| function CityRPGPickaxeImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal) | |
| { | |
| if(%col.getClassName() $= "fxDTSBrick") | |
| { | |
| %brickData = %col.getDatablock(); | |
| if(%brickData.isRock) | |
| %col.onMine(%obj.client); | |
| } | |
| parent::onHitObject(%this, %obj, %slot, %col, %pos, %normal); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment