Magic traps (#1662)

* magic trap

* demiplan

* energy

* Permanent

* meta

* ice trap

* fix

* ForkFiltered

* sound trap

* icon and loot

* blacklistTags

* staffs

* fix window

* manacost
This commit is contained in:
Nim
2025-09-02 11:52:37 +03:00
committed by GitHub
parent 6996d44039
commit b01938ddcf
20 changed files with 793 additions and 3 deletions

View File

@@ -0,0 +1,187 @@
- type: entity
id: CP14ActionSpellElectricTrap
parent: CP14ActionSpellBase
name: Electric trap
description: Creates a electric trap at the selected location. Don't forget to recharge it with mana.
components:
- type: Sprite
sprite: _CP14/Actions/Spells/electromancy.rsi
state: electric_trap
- type: CP14MagicEffectCastSlowdown
speedMultiplier: 0.9
- type: CP14ActionManaCost
manaCost: 40
- type: CP14MagicEffect
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14ImpactEffectElectricTrap
effects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14SpawnMagicElectricTrap
- type: CP14ActionSpeaking
startSpeech: "Signum electricum..."
endSpeech: "hunc locum custodi"
- type: CP14MagicEffectCastingVisual
proto: CP14RuneElectricTrap
- type: Action
icon:
sprite: _CP14/Actions/Spells/electromancy.rsi
state: electric_trap
- type: TargetAction
range: 3
- type: WorldTargetAction
event: !type:CP14DelayedWorldTargetActionEvent
cooldown: 4
- type: entity
id: CP14RuneElectricTrap
parent: CP14BaseMagicTrap
categories: [ HideSpawnMenu ]
save: false
components:
- type: PointLight
color: "#e8ff4c"
- type: Sprite
layers:
- state: small_circle
color: "#e8ff4c"
shader: unshaded
- state: rune_fire
color: "#e8ff4c"
shader: unshaded
- type: entity
id: CP14ImpactEffectElectricTrap
parent: CP14BaseMagicImpact
categories: [ HideSpawnMenu ]
save: false
components:
- type: Sprite
layers:
- state: particles_up
color: "#e8ff4c"
shader: unshaded
- type: entity
id: CP14SpawnMagicElectricTrap
parent: CP14BaseMagicTrap
name: electric trap
description: A rune of electric drawn on the ground using magic — it's best not to step on it.
categories: [ ForkFiltered ]
components:
- type: Sprite
layers:
- state: small_circle
color: "#e8ff4c"
shader: unshaded
- state: rune_energia
color: "#e8ff4c"
shader: unshaded
- type: Fixtures
fixtures:
trap:
shape:
!type:PhysShapeAabb
bounds: "-0.2,-0.2,0.2,0.2"
hard: false
mask:
- MobMask
layer:
- SlipLayer
- type: CP14MagicEnergyExaminable
- type: CP14MagicEnergyContainer
maxEnergy: 42
energy: 42
unsafeSupport: true
- type: CP14MagicEnergyDraw
energy: -0.5
delay: 5
- type: CP14MagicUnsafeDamage
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 1
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: TriggerOnCollide
fixtureID: trap
- type: SpawnOnTrigger
proto: CP14ActionSpellElectricTrapEffect
- type: DeleteOnTrigger
- type: entity
id: CP14ActionSpellElectricTrapEffect
name: electric star
categories: [ HideSpawnMenu ]
save: false
components:
- type: Sprite
sprite: _CP14/Effects/Magic/cast_impact.rsi
drawdepth: Mobs
noRot: true
layers:
- state: stars
color: "#e8ff4c"
shader: unshaded
- type: TimedDespawn
lifetime: 1
- type: Tag
tags:
- HideContextMenu
- type: CP14AreaEntityEffect
range: 2
effects:
- !type:CP14SpellApplyEntityEffect
effects:
- !type:HealthChange
ignoreResistances: false
damage:
types:
Shock: 10
- !type:MovespeedModifier
walkSpeedModifier: 1.3
sprintSpeedModifier: 1.3
statusLifetime: 4
- !type:Jitter
- !type:CP14StaminaChange
staminaDelta: -100
- type: EmitSoundOnTrigger
sound:
path: /Audio/Effects/PowerSink/electric.ogg
params:
variation: 0.1
volume: -2
- type: TriggerOnSpawn
- type: entity
parent: CP14BaseSpellScrollElectric
id: CP14SpellScrollElectricTrap
name: electric trap spell scroll
components:
- type: CP14SpellStorage
spells:
- CP14ActionSpellElectricTrap
- type: entity
parent: CP14SpawnMagicElectricTrap
id: CP14SpawnMagicElectricTrapInvisible
suffix: Invisible. Permanent
components:
- type: Visibility
layer: 16
- type: CP14MagicEnergyDraw
energy: 0
delay: 0
- type: entity
parent: CP14SpawnMagicElectricTrap
id: CP14SpawnMagicElectricTrapPermanent
suffix: Permanent
components:
- type: CP14MagicEnergyDraw
energy: 0
delay: 0

View File

@@ -0,0 +1,152 @@
- type: entity
id: CP14ActionSpellFireTrap
parent: CP14ActionSpellBase
name: Fire trap
description: Creates a fire trap at the selected location. Don't forget to recharge it with mana.
components:
- type: Sprite
sprite: _CP14/Actions/Spells/fire.rsi
state: fire_trap
- type: CP14MagicEffectCastSlowdown
speedMultiplier: 0.9
- type: CP14ActionManaCost
manaCost: 40
- type: CP14MagicEffect
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14ImpactEffectFireTrap
effects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14SpawnMagicFireTrap
- type: CP14ActionSpeaking
startSpeech: "Signum ignis..."
endSpeech: "hunc locum custodi"
- type: CP14MagicEffectCastingVisual
proto: CP14RuneFireTrap
- type: Action
icon:
sprite: _CP14/Actions/Spells/fire.rsi
state: fire_trap
- type: TargetAction
range: 3
- type: WorldTargetAction
event: !type:CP14DelayedWorldTargetActionEvent
cooldown: 4
- type: entity
id: CP14RuneFireTrap
parent: CP14BaseMagicTrap
categories: [ HideSpawnMenu ]
save: false
components:
- type: PointLight
color: "#eea911"
- type: Sprite
layers:
- state: small_circle
color: "#fdda5d"
shader: unshaded
- state: rune_fire
color: "#eea911"
shader: unshaded
- type: entity
id: CP14ImpactEffectFireTrap
parent: CP14BaseMagicImpact
categories: [ HideSpawnMenu ]
save: false
components:
- type: Sprite
layers:
- state: particles_up
color: "#eea911"
shader: unshaded
- type: entity
id: CP14SpawnMagicFireTrap
parent: CP14BaseMagicTrap
name: fire trap
description: A rune of fire drawn on the ground using magic — it's best not to step on it.
categories: [ ForkFiltered ]
components:
- type: Sprite
layers:
- state: small_circle
color: "#fdda5d"
shader: unshaded
- state: rune_fire
color: "#eea911"
shader: unshaded
- type: Fixtures
fixtures:
trap:
shape:
!type:PhysShapeAabb
bounds: "-0.2,-0.2,0.2,0.2"
hard: false
mask:
- MobMask
layer:
- SlipLayer
- type: CP14MagicEnergyExaminable
- type: CP14MagicEnergyContainer
maxEnergy: 42
energy: 42
unsafeSupport: true
- type: CP14MagicEnergyDraw
energy: -0.5
delay: 5
- type: CP14MagicUnsafeDamage
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 1
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: TriggerOnCollide
fixtureID: trap
- type: IgnitionSource
temperature: 400
ignited: true
- type: IgniteOnCollide
fireStacks: 3
- type: ExplodeOnTrigger
- type: Explosive
explosionType: FireBomb
totalIntensity: 10.0
intensitySlope: 4
maxIntensity: 3
- type: DeleteOnTrigger
- type: entity
parent: CP14BaseSpellScrollFire
id: CP14SpellScrollFireTrap
name: fire trap spell scroll
components:
- type: CP14SpellStorage
spells:
- CP14ActionSpellFireTrap
- type: entity
parent: CP14SpawnMagicFireTrap
id: CP14SpawnMagicFireTrapInvisible
suffix: Invisible. Permanent
components:
- type: Visibility
layer: 16
- type: CP14MagicEnergyDraw
energy: 0
delay: 0
- type: entity
parent: CP14SpawnMagicFireTrap
id: CP14SpawnMagicFireTrapPermanent
suffix: Permanent
components:
- type: CP14MagicEnergyDraw
energy: 0
delay: 0

View File

@@ -0,0 +1,193 @@
- type: entity
id: CP14ActionSpellIceTrap
parent: CP14ActionSpellBase
name: Ice trap
description: Creates a ice trap at the selected location. Don't forget to recharge it with mana.
components:
- type: Sprite
sprite: _CP14/Actions/Spells/water.rsi
state: ice_trap
- type: CP14MagicEffectCastSlowdown
speedMultiplier: 0.9
- type: CP14ActionManaCost
manaCost: 40
- type: CP14MagicEffect
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14ImpactEffectIceTrap
effects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14SpawnMagicIceTrap
- type: CP14ActionSpeaking
startSpeech: "Signum glaciei..."
endSpeech: "hunc locum custodi"
- type: CP14MagicEffectCastingVisual
proto: CP14RuneIceTrap
- type: Action
icon:
sprite: _CP14/Actions/Spells/water.rsi
state: ice_trap
- type: TargetAction
range: 3
- type: WorldTargetAction
event: !type:CP14DelayedWorldTargetActionEvent
cooldown: 4
- type: entity
id: CP14RuneIceTrap
parent: CP14BaseMagicTrap
categories: [ HideSpawnMenu ]
save: false
components:
- type: PointLight
color: "#eea911"
- type: Sprite
layers:
- state: small_circle
color: "#5eabeb"
shader: unshaded
- state: rune_ice
color: "#5eabeb"
shader: unshaded
- type: entity
id: CP14ImpactEffectIceTrap
parent: CP14BaseMagicImpact
categories: [ HideSpawnMenu ]
save: false
components:
- type: Sprite
layers:
- state: particles_up
color: "#5eabeb"
shader: unshaded
- type: entity
id: CP14SpawnMagicIceTrap
parent: CP14BaseMagicTrap
name: ice trap
description: A rune of ice drawn on the ground using magic — it's best not to step on it.
categories: [ ForkFiltered ]
components:
- type: Sprite
layers:
- state: small_circle
color: "#5eabeb"
shader: unshaded
- state: rune_ice
color: "#5eabeb"
shader: unshaded
- type: Fixtures
fixtures:
trap:
shape:
!type:PhysShapeAabb
bounds: "-0.2,-0.2,0.2,0.2"
hard: false
mask:
- MobMask
layer:
- SlipLayer
- type: CP14MagicEnergyExaminable
- type: CP14MagicEnergyContainer
maxEnergy: 42
energy: 42
unsafeSupport: true
- type: CP14MagicEnergyDraw
energy: -0.5
delay: 5
- type: CP14MagicUnsafeDamage
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 1
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: TriggerOnCollide
fixtureID: trap
- type: DeleteOnTrigger
- type: EmitSoundOnTrigger
sound:
collection: ToySqueak
- type: SpawnOnTrigger
proto: CP14ActionSpellIceTrapEffect
- type: entity
id: CP14ActionSpellIceTrapEffect
name: ice circle
categories: [ HideSpawnMenu ]
save: false
components:
- type: Sprite
sprite: _CP14/Effects/Magic/cast_impact.rsi
drawdepth: Mobs
noRot: true
layers:
- state: circle_decrease
color: "#5eabeb"
shader: unshaded
- type: TimedDespawn
lifetime: 1
- type: Tag
tags:
- HideContextMenu
- type: CP14AreaEntityEffect
range: 1
effects:
- !type:CP14SpellApplyEntityEffect
effects:
- !type:HealthChange
ignoreResistances: false
damage:
types:
Cold: 10
- !type:MovespeedModifier
walkSpeedModifier: 0.0
sprintSpeedModifier: 0.0
statusLifetime: 3
- !type:AdjustTemperature
amount: -50000
- !type:ExtinguishReaction
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14WindowMagicIceBlock
- type: EmitSoundOnTrigger
sound:
path: /Audio/Effects/balloon-pop.ogg
params:
variation: 0.1
volume: -2
- type: TriggerOnSpawn
- type: entity
parent: CP14BaseSpellScrollWater
id: CP14SpellScrollIceTrap
name: ice trap spell scroll
components:
- type: CP14SpellStorage
spells:
- CP14ActionSpellIceTrap
- type: entity
parent: CP14SpawnMagicIceTrap
id: CP14SpawnMagicIceTrapInvisible
suffix: Invisible. Permanent
components:
- type: Visibility
layer: 16
- type: CP14MagicEnergyDraw
energy: 0
delay: 0
- type: entity
parent: CP14SpawnMagicIceTrap
id: CP14SpawnMagicIceTrapPermanent
suffix: Permanent
components:
- type: CP14MagicEnergyDraw
energy: 0
delay: 0

View File

@@ -44,3 +44,20 @@
sprite: _CP14/Effects/Magic/cast_impact.rsi
noRot: true
- type: entity
id: CP14BaseMagicTrap
name: magic trap
description: Manifestation of magical energy in the physical plane
abstract: true
components:
- type: Transform
anchored: false
- type: InteractionOutline
- type: Damageable
damageContainer: CP14Spectral
- type: Physics
bodyType: Static
- type: Sprite
noRot: true
drawDepth: FloorTiles
sprite: _CP14/Effects/Magic/magic_trap.rsi

View File

@@ -150,3 +150,14 @@
shader: unshaded
color: "#1c94d9"
- type: entity
abstract: true
id: CP14BaseSpellScrollElectric
parent: CP14BaseSpellScroll
components:
- type: Sprite
layers:
- state: paper_filled
- state: magic
shader: unshaded
color: "#e8ff4c"

View File

@@ -48,6 +48,8 @@
- id: CP14BaseLockpick
- id: CP14EnergyCrystalMediumEmpty
- id: CP14ClothingCloakAmuletGold
- id: CP14SpellScrollElectricTrap
- id: CP14SpellScrollIceTrap
# Rare standard village crates loot
- !type:NestedSelector
tableId: CP14StationCrateLoot
@@ -84,6 +86,7 @@
weight: 2 #Temp (small amount T2 loot)
- !type:GroupSelector
children:
- id: CP14SpellScrollFireTrap
- id: CP14SpellScrollShadowStep
- id: CP14SpellScrollFireball
- id: CP14SpellScrollBeerCreation

View File

@@ -116,6 +116,7 @@
components:
- type: CP14SpellStorage
spells:
- CP14ActionSpellElectricTrap
- CP14ActionSpellLightningStrike
- CP14ActionSpellLightningStrikeSmall
- CP14ActionSpellLightningStrikeSmall

View File

@@ -32,3 +32,78 @@
params:
variation: 0.03
- type: entity
id: CP14WindowMagicIceBlock
name: magic ice block
description: Ice created by magic with a distinct purple hue.
categories: [ ForkFiltered ]
placement:
mode: SnapgridCenter
snap:
- Window
components:
- type: Sprite
drawdepth: Mobs
sprite: _CP14/Structures/Windows/ice_block.rsi
color: "#5eabeb"
- type: Icon
sprite: _CP14/Structures/Windows/ice_block.rsi
state: full
- type: IconSmooth
key: CP14window
base: window
- type: PlacementReplacement
key: walls
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Glass
- type: TriggerOnCollide
fixtureID: fix1
- type: Appearance
- type: Transform
anchored: true
- type: Clickable
- type: Physics
bodyType: Static
- type: Fixtures
fixtures:
fix1:
hard: false
shape:
!type:PhysShapeAabb
bounds: "-0.5,-0.5,0.5,0.5"
density: 1000
mask:
- TableMask
layer:
- TableLayer
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 15
behaviors:
- !type:PlaySoundBehavior
sound:
collection: WindowShatter
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: MeleeSound
soundGroups:
Brute:
collection: GlassSmash
- type: SpeedModifierContacts
walkSpeedModifier: 0.1
sprintSpeedModifier: 0.1
- type: DamageOnAttacked
damage:
types:
Cold: 2
- type: DamageOnInteract
damage:
types:
Cold: 2
- type: DamageContacts
damage:
types:
Cold: 1

View File

@@ -0,0 +1,87 @@
- type: cp14LocationModifier
id: IceTrapInvisible
levels:
min: 3
max: 10
categories:
Danger: 0.1
blacklistTags:
- CP14DemiplaneHot
layers:
- !type:CP14OreDunGen
entity: CP14SpawnMagicIceTrapInvisible
count: 5
minGroupSize: 1
maxGroupSize: 1
- type: cp14LocationModifier
id: IceTrapPermanent
levels:
min: 3
max: 10
categories:
Danger: 0.1
blacklistTags:
- CP14DemiplaneHot
layers:
- !type:CP14OreDunGen
entity: CP14SpawnMagicIceTrapPermanent
count: 10
minGroupSize: 1
maxGroupSize: 1
- type: cp14LocationModifier
id: FireTrapInvisible
levels:
min: 3
max: 10
categories:
Danger: 0.1
layers:
- !type:CP14OreDunGen
entity: CP14SpawnMagicFireTrapInvisible
count: 5
minGroupSize: 1
maxGroupSize: 1
- type: cp14LocationModifier
id: FireTrapPermanent
levels:
min: 3
max: 10
categories:
Danger: 0.1
layers:
- !type:CP14OreDunGen
entity: CP14SpawnMagicFireTrapPermanent
count: 10
minGroupSize: 1
maxGroupSize: 1
- type: cp14LocationModifier
id: ElectricTrapInvisible
levels:
min: 2
max: 10
categories:
Danger: 0.1
layers:
- !type:CP14OreDunGen
entity: CP14SpawnMagicElectricTrapInvisible
count: 5
minGroupSize: 1
maxGroupSize: 1
- type: cp14LocationModifier
id: ElectricTrapPermanent
levels:
min: 2
max: 10
categories:
Danger: 0.1
layers:
- !type:CP14OreDunGen
entity: CP14SpawnMagicElectricTrapPermanent
count: 10
minGroupSize: 1
maxGroupSize: 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -5,7 +5,7 @@
"y": 32
},
"license": "All right reserved",
"copyright": "Created by TheShuEd",
"copyright": "Created by TheShuEd, electric_trap by nimfar11",
"states": [
{
"name": "lightning_strike"
@@ -15,6 +15,9 @@
},
{
"name": "speed_music"
},
{
"name": "electric_trap"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -5,7 +5,7 @@
"y": 32
},
"license": "All right reserved",
"copyright": "Created by .kreks., tiefling_revenge, fire_music, firewave by TheShuEd",
"copyright": "Created by .kreks., tiefling_revenge, fire_music, firewave by TheShuEd, fire_trap by nimfar11",
"states": [
{
"name": "fire_music"
@@ -24,6 +24,9 @@
},
{
"name": "firewave"
},
{
"name": "fire_trap"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -5,7 +5,7 @@
"y": 32
},
"license": "All right reserved",
"copyright": "Created by TheShuEd, ice dagger by .kreks.",
"copyright": "Created by TheShuEd, ice_dagger by .kreks., ice_trap by nimfar11",
"states": [
{
"name": "beer_creation"
@@ -24,6 +24,9 @@
},
{
"name": "water_creation"
},
{
"name": "ice_trap"
}
]
}

View File

@@ -0,0 +1,55 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-4.0",
"copyright": "Created by Nimfar11",
"states": [
{
"name": "small_circle",
"delays": [
[
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "rune_fire",
"delays": [
[
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "rune_energia",
"delays": [
[
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "rune_ice",
"delays": [
[
0.2,
0.2,
0.2,
0.2
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB