001package com.fs.starfarer.api.fleet; 002 003import java.util.Random; 004 005 006public interface FleetMemberStatusAPI { 007 /** 008 * Total hull damage (as a fraction) since resetDamageTaken() was last called. 009 * @return 010 */ 011 float getHullDamageTaken(); 012 013 /** 014 * From 0 to 1. 015 * @return 016 */ 017 float getHullFraction(); 018 019 /** 020 * After this call, getHullDamageTaken() will return 0 until the ship takes more damage. 021 */ 022 void resetDamageTaken(); 023 024 025 /** 026 * Repairs the disabled ship's hull a few percentage points. 027 */ 028 void repairDisabledABit(); 029 030 031 void disable(); 032 void repairFully(); 033 void repairFullyNoNewFighters(); 034 035 void repairFraction(float fraction); 036 037 /** 038 * Applies damage in a random location on the hull. In the case of a fighter wing, first picks a random wing member. 039 * @param hitStrength 040 */ 041 void applyDamage(float hitStrength); 042 043 044 /** 045 * Applied to a random location on the hull, deals guaranteed amount of hull damage, expressed as a fraction of the maximum hull value. 046 * 047 * 048 * 049 * @param fraction 050 */ 051 void applyHullFractionDamage(float fraction); 052 053 054 /** 055 * Useful for applying damage to specific fighters. 056 * 057 * @param fraction 058 * @param index 059 */ 060 void applyHullFractionDamage(float fraction, int index); 061 062 /** 063 * @return 1, or number of fighters in the wing, or number of modules including the base. 064 */ 065 int getNumStatuses(); 066 067 void setHullFraction(float fraction); 068 069 void repairArmorAllCells(float fraction); 070 void repairHullFraction(float fraction); 071 072 float getArmorDamageTaken(); 073 074 void setRandom(Random random); 075 076 Random getRandom(); 077 078 void setDetached(int index, Boolean detached); 079 void setHullFraction(int index, float hullFraction); 080 float getHullFraction(int index); 081 boolean isDetached(int index); 082 083 boolean needsRepairs(); 084 085 void setPermaDetached(int index, Boolean detached); 086 087 boolean isPermaDetached(int index); 088 089 void resetAmmoState(); 090 091 void applyDamage(float hitStrength, float forceHullFractionDamage); 092 093}