#[Modding] How to make entity immune to explosion damage

1 messages · Page 1 of 1 (latest)

nocturne mango
#

The main damaging systems of Core Keeper in v1.1.2.10, AttackSystem and AttackPlayerSystem use a FactionCD component as part of the can hit flow.

FactionCD also exposes a way to "befriend" in game factions with a FactionCD.SetBefriendedFaction(FactionID faction, bool befriend) method.

Currently FactionID is an enum with the following possibilities.

Larva
Caveling
Slime
Neutral
Player
OnlyAttacksPlayer
Bird
AttacksAllButNotAttacked
MoldInfected
NatureCaveling
Merchant
SeaCaveling
AttacksAllButNotPlayer
SeaCreature
Scarab
LavaCreature
CanOnlyBeAttackedByPlayerOrExplosion
UnfriendlyAgainstAll
DesertCaveling
CrystalCreature
MushroomEnemy
CoreBoss
PlayerMinion
PassageEnemy
Explosion

Adding a FactionCD component befriended to FactionID.Explosion to an entity with HealthCD makes it immune to explosion damage.

#

@karmic berry

brave harness
#

Holy...........

karmic berry
#

oh my god it was that simple...

brave harness
#

We've been struggling on this since last year

karmic berry
#

:D

#

FactionCD is the first thing we tried, but i gave up without trying out everything...

#

Thanks a lot for the help Sashiri!!

nocturne mango
#

Np. gl hf o/ Finaly had some time to read up what you were cooking on the modding channel