* Get the unit's minimap sprite index. Used to display the unit on the minimap * @return the unit minimap index */
| 1985 | * @return the unit minimap index |
| 1986 | */ |
| 1987 | int BattleUnit::getMiniMapSpriteIndex () const |
| 1988 | { |
| 1989 | //minimap sprite index: |
| 1990 | // * 0-2 : Xcom soldier |
| 1991 | // * 3-5 : Alien |
| 1992 | // * 6-8 : Civilian |
| 1993 | // * 9-11 : Item |
| 1994 | // * 12-23 : Xcom HWP |
| 1995 | // * 24-35 : Alien big terror unit(cyberdisk, ...) |
| 1996 | if (isOut()) |
| 1997 | { |
| 1998 | return 9; |
| 1999 | } |
| 2000 | switch (getFaction()) |
| 2001 | { |
| 2002 | case FACTION_HOSTILE: |
| 2003 | if (_armor->getSize() == 1) |
| 2004 | return 3; |
| 2005 | else |
| 2006 | return 24; |
| 2007 | case FACTION_NEUTRAL: |
| 2008 | return 6; |
| 2009 | default: |
| 2010 | if (_armor->getSize() == 1) |
| 2011 | return 0; |
| 2012 | else |
| 2013 | return 12; |
| 2014 | } |
| 2015 | } |
| 2016 | |
| 2017 | /** |
| 2018 | * Set the turret type. -1 is no turret. |