0 Members and 1 Guest are viewing this topic.
Copy Robot demonstrates something like that in CSCC. Unless you mean to also remove their weapon, too..
pain.zard:PLAY H 0 A_SpawnItemEx("ZardThiefGiver")goto Pain+1
actor ZardThiefGiver : JunkWatcher//Junk Watcher is the in JunkShield.txt, it handles the effects created by the junk shield.{states//I almost forgot what the pointer was called o-o{Spawn:TNT1 A 0TNT1 A 0 A_GiveToTarget("ZardWeaponSteal",1)stop}}actor ZardWeaponSteal : CustomInventory{+INVENTORY.AUTOACTIVATEStates{Use:TNT1 A 0TNT1 A 0 ACS_ExecuteAlways(1020, 0)stop}}
#DEFINE NUM_WEAPONS 68str weaponNames[NUM_WEAPONS] = {"BubbleLeadWep","ShadowBladeWep","NapalmBombWep","AtomicFireWep","LeafShieldWep","AirShooterWep","HyperBombWep","MagnetMissileWep","TopSpinWep","NeedleCannonWep","GeminiLaserWep","SearchSnakeWep",TimeStopperWep","SuperArmWep","IceSlasherWep","ThunderBeamWep","MetalBladeWep","HardKnuckleWep","DrillBombWep","BlizzardAttackWep","FireStormWep","QuickBoomerangWep","CrashBombWep","ChargeKickWep","RollingCutterWep","SparkShockWep","RingBoomerangWep","GyroAttackWep","PowerStoneWep","DustCrusherWep","PharaohShotWep","WaterWaveWep","CrystalEyeWep","SkullBarrierWep","FlameBlastWep","YamatoSpearWep","DiveMissileWep","PlantBarrierWep","SilverTomahawkWep","WindStormWep","KnightCrushWep","StarCrashWep","RainFlushWep","SakugarneWep","BalladeCrackerWep","ScrewCrusherWep","FlashStopperWep","GravityHoldWep","CentaurFlashWep","MirrorBusterWep","FreezeCrackerWep","NoiseCrushWep","WildCoilWep","DangerWrapWep","ScorchWheelWep","JunkShieldWep","SlashClawWep","ThunderBoltWep","AstroCrushWep","FlameSwordWep","ThunderClawWep","HomingSniperWep","WaterBalloonWep","MegaBallWep","FlashBombWep","IceWaveWep","TornadoHoldWep","TimeSlowWep","OilSliderWep"};script 1010 (void){int ttid = ACS_ExecuteWithResult(257, 0);//Thing ID of the attackerint otid = ActivatorTID();//Thing ID of the targetint wep = -1;for(int i = 0; i < NUM_WEAPONS; i++){//Loops the following set of code until it finds what it is looking forif(CheckWeapon(weaponNames[i]){wep = i;break;}}if(i==-1){print(s:"Unable to steal a weapon."); terminate;}TakeInventory(weaponNames[wep], 99);if(!CheckActorInventory(ttid, weaponNames[wep]))GiveActorInventory(ttid, weaponNames[wep], 1);}
[Zard]WELLFirst you would want find the target player to check which weapon they have selected by using ACS and the CheckWeapon() function to check for every weapon in the game. Then you would need to take that weapon away from said player using TakeInventory() and check to see if the attacking player has that weapon, if they do not, give them said weapon.The most complicated part of all of this would be acquiring the Thing ID of the attacking player, but all of this can be done via ACS...let me just...um...Put this in the player class:In "pain.zard" change "zard" to the "damagetype" of your projectile.You can also change any of the actor names to whatever you wish. (click to show/hide)Code: [Select]pain.zard:PLAY H 0 A_SpawnItemEx("ZardThiefGiver")goto Pain+1Place this in the class file, but not in its actor definition (click to show/hide)Code: [Select]actor ZardThiefGiver : JunkWatcher//Junk Watcher is the in JunkShield.txt, it handles the effects created by the junk shield.{states//I almost forgot what the pointer was called o-o{Spawn:TNT1 A 0TNT1 A 0 A_GiveToTarget("ZardWeaponSteal",1)stop}}actor ZardWeaponSteal : CustomInventory{+INVENTORY.AUTOACTIVATEStates{Use:TNT1 A 0TNT1 A 0 ACS_ExecuteAlways(1020, 0)stop}}Place this in an ACS script somewhere [WCOLORS or GLOBAL if you didn't make your own]: (click to show/hide)Code: [Select]#DEFINE NUM_WEAPONS 68str weaponNames[NUM_WEAPONS] = {"BubbleLeadWep","ShadowBladeWep","NapalmBombWep","AtomicFireWep","LeafShieldWep","AirShooterWep","HyperBombWep","MagnetMissileWep","TopSpinWep","NeedleCannonWep","GeminiLaserWep","SearchSnakeWep",TimeStopperWep","SuperArmWep","IceSlasherWep","ThunderBeamWep","MetalBladeWep","HardKnuckleWep","DrillBombWep","BlizzardAttackWep","FireStormWep","QuickBoomerangWep","CrashBombWep","ChargeKickWep","RollingCutterWep","SparkShockWep","RingBoomerangWep","GyroAttackWep","PowerStoneWep","DustCrusherWep","PharaohShotWep","WaterWaveWep","CrystalEyeWep","SkullBarrierWep","FlameBlastWep","YamatoSpearWep","DiveMissileWep","PlantBarrierWep","SilverTomahawkWep","WindStormWep","KnightCrushWep","StarCrashWep","RainFlushWep","SakugarneWep","BalladeCrackerWep","ScrewCrusherWep","FlashStopperWep","GravityHoldWep","CentaurFlashWep","MirrorBusterWep","FreezeCrackerWep","NoiseCrushWep","WildCoilWep","DangerWrapWep","ScorchWheelWep","JunkShieldWep","SlashClawWep","ThunderBoltWep","AstroCrushWep","FlameSwordWep","ThunderClawWep","HomingSniperWep","WaterBalloonWep","MegaBallWep","FlashBombWep","IceWaveWep","TornadoHoldWep","TimeSlowWep","OilSliderWep"};script 1010 (void){int ttid = ACS_ExecuteWithResult(257, 0);//Thing ID of the attackerint otid = ActivatorTID();//Thing ID of the targetint wep = -1;for(int i = 0; i < NUM_WEAPONS; i++){//Loops the following set of code until it finds what it is looking forif(CheckWeapon(weaponNames[i]){wep = i;break;}}if(i==-1){print(s:"Unable to steal a weapon."); terminate;}TakeInventory(weaponNames[wep], 99);if(!CheckActorInventory(ttid, weaponNames[wep]))GiveActorInventory(ttid, weaponNames[wep], 1);}WHOO...that was a mouthful.Please note that my code will have some assembly required in terms of creating your pk3. Do not expect it to work straight out of the box.[especially in these untested incidents...]
actor RollRageMode : PowerupGiver{+COUNTITEM+INVENTORY.AUTOACTIVATE+INVENTORY.ALWAYSPICKUPInventory.MaxAmount 0Powerup.Type "PowerRollDefense"Powerup.Color 255 123 255, 0.4Powerup.Duration -50States{Spawn:TNT1 A 1Loop}}
actor MyScreenColorPowerup : Powerup{Powerup.Color <RGB or color name here>, <opacity>Powerup.Duration <duration in seconds or tics>}