pacas00 / ModdersGearbox

A Fortresscraft Evolved Modding Library.
MIT License
1 stars 0 forks source link

Ability to set Mob drops by XML. #11

Open ph3rr3t opened 5 years ago

ph3rr3t commented 5 years ago

What it says on the tin.

First we need a way to get the in code names / keys of the mobs in the game. Surface Slimes, Cold Slimes, Toxic Slimes, Magma Slimes, Wasps, Nukers, Heavies, Bosses, EMP Wasps, etc, etc.

<[MobDropsEntry>
     <MobKey>SurfaceSlimeKey</MobKey>
     <IsOverride>False</IsOverride> <!--For mod stack-ability.-->
     <DropEntry>
          <DropKey>BrokenPhosporecentGland</DropKey> <!--Any block or item key works.-->
          <DropChance>9</DropChance> <!--Odds of this being dropped out of combined drop chance.-->
     </DropEntry>
     <DropEntry>
          <DropKey>PhosporecentGland</DropKey>
          <DropChance>1</DropChance>
     </DropEntry>
<MobDropsEntry>

Combined drop chance is all drop chances for that MobKey added together. So SurfaceSlimeKey would have 9 + 1 = 10. 9 out of 10 chance for a broken gland, and 1 out of 10 chance for an unbroken gland.

This is actually a cut down version of what the original idea turned into, but that is currently a jumbled looking mess to my eyes, so I'll just give you what I currently have of it. Just change the file extension to xml to get the properly collapsible version. I didn't mean for it to get so out of hand. ExMobStats.txt If this is something worth pursing in your opinion, I'll go ahead and clean it up more, as well as add in any more parameters I can think of. (And give it, its own Feature Request.)

pacas00 commented 5 years ago
BlobMob - All Slimes

private ushort GetDropType() returns 0 for item, ushort for block
private int GetItemDrop() returns item id;

//Dont know which wasp it is, or what wasp mobs these handle

Wasp
public void Damage(int lnDamage) would need replacing

WaspMob
private void DropLoot() would need replacing

TD_WaspMob
private void DropLoot() would need replacing

TD_TunnelNuker

No support for dropping, would need a hook on
public override int TakeDamage(int lnDamage)
ph3rr3t commented 5 years ago

The FCE wiki has most, if not all of them for once. http://fortresscrafte.wikia.com/wiki/Entities I know there is at least Surface Slimes, Cold Slimes, & Magma Slimes. Don't know if I've ever seen a Toxic Slime.

pacas00 commented 5 years ago

All Slimes are BlobMob, All Wasps use one of those 3 wasp classes, nukers have their own class. CamoBots are class named the same, All worms are WormBoss.

pacas00 commented 5 years ago

BlobMobs choose their colour via their spawn height.

    eBlob_Snow,
    eBlob_Green,
    eBlob_Sand,
    eBlob_Gold,
    eBlob_Magma,
    eBlob_Gray,
    eBlob_Blue,
    eBlob_Silver,
pacas00 commented 5 years ago

MobType enum keys for mobs are as follows, not a full list obviously.

CamoBot,
Wasp,
OozeBlob,
TD_Wasp,
TD_Wasp_Fast,
TD_Wasp_Heavy,
TD_Wasp_Boss,
TD_TunnelNuker,
WormBoss,
WormBossLava,
TD_EMP,
pacas00 commented 5 years ago

At some other point, ill work out which wasp is used by what class and document it here.