Skip to content

Instantly share code, notes, and snippets.

@warmist
Last active September 21, 2015 19:28
Show Gist options
  • Save warmist/3017dc796a6173c215bb to your computer and use it in GitHub Desktop.
Save warmist/3017dc796a6173c215bb to your computer and use it in GitHub Desktop.
function research for df enemy_cache
function: sub_C59740
arg0 -> other unit
ecx -> this unit
Research enemy_cache values:
Asume ecx=edi-> this
and ebp->other
* this==other -> 3
* other.flags3 & 1200h -> 4 // ghostly | wait_until_reveal
* other.flags1 & 201002h -> 5 // dead | projectile | caged
* other.flags3 << 10 & 1 -> 6 //scuttle? probably not
* this.flags3 & 1000h -> 7 //ghostly
* IN ADVENTURE_ARENA or DWARF_ARENA
* if this->combat_side_id==0 -> 8
* if this->combat_side_id==other->combat_side_id -> 9
* else -> 8
* DWARF MODE
* this.flags1 & 8000000h // chained?
* and not friendly(other) -> 10
* this.relations.dragger_id !=0 && find_unit(dragger_id)!=0 && is_friendly(dragger) && is_friendly(other) ->11
* is_friendly(this)
* other.flags1 & 8000000h /*chained */ -> 12
* other.relations.dragger_id !=0 && find_unit(dragger_id)!=0 && is_friendly(dragger) ->13
*ADV MODE | DWARF MODE
<some sort of scuttle/caste checks?>
* this.race!=other.race ->14
* this.race==other.race
* this.mood==berserk ->14
* other.mood==berserk ->14
* this.soldier_mood==1 && current_soul!=0 && emotion stuff ->14
* this.hist_figure_id==0 || other.hist_figure_id==0 -> complicated...
* caste_checks??(this)==0 && caste_checks??(other) && (hist_figure(this)==0 || hist_figure(other))==0 ->0
*hist_figure(other)!=0 &&
* undeadish ->15
* other_undeadish -> 16
@expwnent
Copy link

Is this an if/elseif block sort of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment