Thank you.
Thank you.
if (entity is MiniCopter)
return CombatEntityType.Minicopter;
Update the CombatEntityType Enum around line 400 to add a Minicopter entity type after None:
None = 15,
Minicopter = 16
Update GetEntityName around line 356 to handle Minicopters.
if (entity == null &&
combatEntityType != CombatEntityType.Helicopter &&
combatEntityType != CombatEntityType.Bradley)
return null;
To:
if (entity == null &&
combatEntityType != CombatEntityType.Helicopter &&
combatEntityType != CombatEntityType.Bradley &&
combatEntityType != CombatEntityType.Minicopter)
return null;
and then add this after CombatEntityType.Helicopter in the switch statement just below that around line 365
case CombatEntityType.Minicopter:
return "Minicopter";
"Minicopter": "Minicopter"
Then add a DeathNote
{
"KillerType": "Minicopter",
"VictimType": "Player",
"DamageType": "Explosion",
"Messages": [
"{victim} died in a fiery explosion after crashing their {killer}."
]
}
Hence a good backup is mandatory! Thanks for this upgrade!! :-Dcisox
Here's how to add Minicopter support to DeathNotes. It requires updating the CS file and your config.
cisox
Here's how to add Minicopter support to DeathNotes.
CombatEntityType.Helicopter in the switch statement just below that around line 365case CombatEntityType.Minicopter: return "Minicopter";
Hello there, I am assuming you mean this:
switch (combatEntityType) { case CombatEntityType.Player: return StripRichText(entity.ToPlayer().displayName); case CombatEntityType.Helicopter: return "Helicopter";case CombatEntityType.Minicopter:return "Minicopter";
When I load it on the server, it outputs:
Error while compiling: DeathNotes.cs(373,51): error CS1525: Unexpected symbol `)', expecting `;' or `}'
Where lines 373 reads:
switch (combatEntityType)
I am a little bit confused about it... Can you help me sorting it out?
switch (combatEntityType); { case CombatEntityType.Player: return StripRichText(entity.ToPlayer().displayName); case CombatEntityType.Helicopter: return "Helicopter";case CombatEntityType.Minicopter:return "Minicopter";
Yet there's another error now:
(15:00:55) | Error while compiling: DeathNotes.cs(402,42): error CS1525: Unexpected symbol `:'
Line 402 is blank, though. Just a blank line....
private CombatEntityType GetCombatEntityType(BaseEntity entity)
{
if (entity == null)
return CombatEntityType.None;
if (_combatEntityTypes.Contents != null && _combatEntityTypes.Contents.ContainsKey(entity.GetType().Name))
return _combatEntityTypes.Contents[entity.GetType().Name];
if (entity is BaseOven)
return CombatEntityType.HeatSource;
if (entity is SimpleBuildingBlock)
return CombatEntityType.ExternalWall;
if (entity is BaseAnimalNPC)
return CombatEntityType.Animal;
if (entity is BaseTrap)
return CombatEntityType.Trap;
if (entity is Barricade)
return CombatEntityType.Barricade;
if (entity is MiniCopter)
return CombatEntityType.Minicopter;
return CombatEntityType.Other;
}
CombatEntityType enum internal enum CombatEntityType
{
Helicopter = 0,
Bradley = 1,
Animal = 2,
Murderer = 3,
Scientist = 4,
Player = 5,
Trap = 6,
Turret = 7,
Barricade = 8,
ExternalWall = 9,
HeatSource = 10,
Fire = 11,
Lock = 12,
ScientistSentry = 13,
Other = 14,
None = 15,
Minicopter = 16
}
GetEntityName private string GetEntityName(BaseEntity entity, CombatEntityType combatEntityType)
{
// Entity may be null for helicopter or bradley, see HandleExceptions(...)
if (entity == null &&
combatEntityType != CombatEntityType.Helicopter &&
combatEntityType != CombatEntityType.Bradley &&
combatEntityType != CombatEntityType.Minicopter)
return null;
switch (combatEntityType)
{
case CombatEntityType.Player:
return StripRichText(entity.ToPlayer().displayName);
case CombatEntityType.Helicopter:
return "Helicopter";
case CombatEntityType.Scientist:
case CombatEntityType.Murderer:
var name = entity.ToPlayer()?.displayName;
return
string.IsNullOrEmpty(name) || name == entity.ToPlayer()?.userID.ToString()
? combatEntityType.ToString()
: name;
case CombatEntityType.Bradley:
return "Bradley APC";
case CombatEntityType.ScientistSentry:
return "Scientist Sentry";
case CombatEntityType.Fire:
return entity.creatorEntity?.ToPlayer()?.displayName ?? "Fire";
case CombatEntityType.Minicopter:
return "Minicopter";
}
if (_enemyPrefabs.Contents.ContainsKey(entity.ShortPrefabName))
return _enemyPrefabs.Contents[entity.ShortPrefabName];
return HumanizePascalCase(entity.GetType().Name);
}
[Player was killed by Minicopter.entity ] is not reported
Found typo
Here's how to add Minicopter support to DeathNotes. It requires updating the CS file and your config.
Update GetCombatEntityType around line 307 and add this entity check after Barricade:
if (entity is MiniCopter)
return CombatEntityType.MiniCopter;â
Update the CombatEntityType Enum around line 400 to add a Minicopter entity type after None:
None = 15,
MiniCopter = 16â
Update GetEntityName around line 356 to handle Minicopters.
if (entity == null &&
combatEntityType != CombatEntityType.Helicopter &&
combatEntityType != CombatEntityType.Bradley)
return null;â
To:
if (entity == null &&
combatEntityType != CombatEntityType.Helicopter &&
combatEntityType != CombatEntityType.Bradley &&
combatEntityType != CombatEntityType.MiniCopter)
return null;â
and then add this after CombatEntityType.Helicopter in the switch statement just below that around line 365
case CombatEntityType.MiniCopter:
return "MiniCopter";