Code Monkey home page Code Monkey logo

7dtd-nozombiedigging's Introduction

No Zombie Digging

By Tigercat2000

For Alpha 20

For the miners like me who are damn tired of zombies scratching at the ground, as well as the bunker builders.

This mod prevents zombie AI from deciding to dig into the ground or target terrain blocks.

Zombies still can and will attack all other blocks as normal to get to heat or players.

Technical Details

This is a Harmony mod that overrides EntityMoveHelper::DigStart and EAIBreakBlock::CanExecute.

EntityMoveHelper::DigStart is responsible for setting up zombies to dig downwards towards a heat source and make tunnels; by overriding it and making it do nothing, zombies will resort to other behavior.

EAIBreakBlock::CanExecute is responsible for all "obstacle in way, attack block?" logic; this is more subtly overridden to check if the targeted block is any type of terrain, and then returns false, forcing the AI to move to the next task.

Limitations

Because I'm lazy and for no other reason, this doesn't prevent zombies from damaging terrain incidentally.

If you build a dirt tower for instance, and the zombie tries to swing at you, but misses and hits the dirt below you, it'll still damage it.

This can be fixed by either overriding Block::OnBlockDamaged, or, easier but more tedious, setting up an items.xml override to add entries like this to all zombie melee weapons:

<append xpath="/items/item[@name='meleeHandZombie01']/effect_group[@name='Base Effects']">
    <passive_effect name="DamageModifier" operation="perc_set" value="0" tags="earth,stone"/>
</append>

Development

See References/README.md for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.