en:rpd:kunai_throw_spell
Table of Contents
Kunai Throw
Description
This spell throws Kunai at random visible enemies extremely fast. The number of Kunai thrown depends on the caster's skill level, with more Kunai thrown at higher levels. The spell is so fast that you can't select the target.
Stats
Mechanics
- Number of Kunai: min(caster:skillLevel() - spellLevel + 1, 3) - maximum of 3 kunai
- Damage: Random damage between n and (n + caster:lvl() * n), where n is the number of kunai thrown
- Targeting: Automatically targets random enemies visible to the caster
- Zap Effect: Shows a “Kunai” zap effect from caster to target
- Requirement: Requires at least one visible enemy to cast
Usage
The Kunai Throw spell can be used for:
Classes
Classes that can use this spell include:
- Classes with Rogue affinity (e.g., Rogue class)
- Other classes that gain access through special means
Strategy
How to effectively use the Kunai Throw spell:
- Best used when multiple enemies are visible to potentially hit several targets
- More effective at higher skill levels when more Kunai can be thrown
- Quick cast time makes it useful in tight situations
- Works well when enemies are grouped together
- Since it targets random enemies, it's useful when you don't need to target a specific one
Technical Details
- Implementation: KunaiThrow.lua
- Class: Lua script implementing the spell system
- Spell availability: CustomSpellsList.lua - available to Rogue class
- String resources: KunaiThrow_Name and KunaiThrow_Info
- Russian string resources: KunaiThrow_Name и KunaiThrow_Info
- Spell system library: spell.lua
- Common classes library: commonClasses.lua
- Spell parameters: level = 2, castTime = 0.01, spellCost = 5
- Tier calculation: math.min(caster:skillLevel() - spellLevel + 1, 3) - calculates number of kunai thrown (max 3)
- Damage calculation: math.random( n, n + caster:lvl()*n ) - damage range based on number of kunai and caster level
- Zap effect: RPD.zapEffect(ownPos,tgt:getPos(),"Kunai") - visual effect from caster to target
- Target selection: caster:randomEnemy() - randomly selects visible enemy as target
- Visible enemies check: caster:visibleEnemies() - ensures at least one enemy is visible before casting
- Image mapping: lvl2img = {1,9,17} based on spell tier - different icon based on number of kunai
- Magic affinity: Magic Affinity: "Rogue" - only available to Rogue-affinity classes
- Targeting type: Targeting: "self" - targets random visible enemies automatically
- Common classes library: commonClasses.lua
- Spell initialization: return spell.init{} - defines the spell structure and behavior
- Damage system integration: tgt:damage() - calls the game's damage system to apply damage to target
- Number of Kunai calculation: local n = spellTier(caster) - calculates kunai count based on caster's skill level
- Spell casting validation: https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/spells/KunaiThrow.lua#L27-L28 - checks if any visible enemies exist before casting
- Class availability: spells["Rogue"] = {"Cloak","Backstab","KunaiThrow","Haste"} - available to Rogue class
- Zap effect types: Implementations.java - defines available zap effects including “Kunai” effect
- Damage system reference: Char:damage() method - handles damage calculation and application
- Character level reference: Char:lvl() method - caster level affects damage calculation
- Target position: Char:getPos() method - gets character position for zap effect
- Random enemy selection: CharUtils:randomEnemy() method - provides random enemy selection functionality
- Visible enemies check: CharUtils:visibleEnemies() method - checks for visible enemies in the level
- Character interface: Char.java - base class for all characters (player, mobs, etc.)
- Skill level reference: CharUtils:skillLevel() method - gets the character's skill level
- RPD API: RPDScriptUtils.java - provides Lua interface for game functionality
- Zap effects implementation: ZapGlow.java - renders zap effects
- Lua integration: LuaEngine.java - integrates Lua scripts with game engine
- Spell casting flow: LuaSpell:cast() method - handles Lua spell invocation
- Spell system: Spell.java - base spell class in Java
- Spell sprites: rogue.png - sprite image file containing spell icons
- Machine-readable data: mr:kunai_throw_spell
Flavor Text
From the game: “This Deadly Kunai throw will be done extremely fast, so fast that you won't even be able to select a target.\n\nTrue Masters able to throw more than one Kunai at once.”
See Also
en/rpd/kunai_throw_spell.txt · Last modified: by 127.0.0.1
