Code Monkey home page Code Monkey logo

xcom2stabilizeme's Introduction

StabilizeMe

TLDR: StabilizeMe mod for XCOM2.
Soldiers gain the ability to stabilize any other soldier that is bleeding out and happens to be carrying a medikit.

A mod for XCOM2

This mod was created to fix one annoying "feature" in the game. The scenario usually goes something like this:

  • <insert alien here> destroys your specialist's cover
  • <insert alien here> scores a critical hit on your specialist
  • Your specialist is knocked unconscious and is bleeding out
    • and by the way, he's the only one with a medikit
  • You go: Oh for f*ck sakes! This is bull!
  • The specialist proceeds to bleed out as nobody around him can help him, even though in practise the victim has a medikit lying right beside him.

How this mod works

The mod's operation is quite simple actually. In essence the mod creates a new ability called 'StabilizeMedkitOwner' and injects it to the soldiers in combat. This image describes the technical aspects of the mod:

Diagram

Explained in short:

  1. We create a new ability, called 'StabilizeMedkitOwner'. This ability is like standard stabilize but with special condition, the X2Condition_StabilizeMedkitOwner that checks that the target unit has the an ability that has a X2Effect_RemoveEffects in its AbilityTargetEffects which removes the class'X2StatusEffects'.default.BleedingOutName. Using the X2Effect_RemoveEffects is the standard way of removing effects from units and most if not all medic mods should be doing it that way, which should make the mod compatible with most other medic related mods out there.

  2. We create a UIScreenListener that listens the screen change to UITacticalHUD. That's when we'll do our dirty work. Once UITacticalHUD is on the screen, we're in tactical combat and we can empower our squad with the new godly medical ability.

Why do we do this only when we enter tactical combat you must be asking - the reason is that in this way even when we load an existing save game in the middle of combat the new abilities get applied. As you load the game, the strategic data is loaded, the squad set up and the tactical UI loaded - and that's when we apply our new ability. So whenever you enter tactical combat your squad members get checked for the ability, if they don't have it yet then the ability gets added.

License

The freedom of MIT license applies, so have fun!

xcom2stabilizeme's People

Contributors

jusas avatar katms avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

katms dotvhs

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.