123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- class Crossbow_RedpointOptic : ItemOptics {};
- class LongrangeOptic : ItemOptics {};
- class PistolOptic : ItemOptics {};
- class GrozaOptic : ItemOptics {};
- class ACOGOptic : ItemOptics {};
- class ACOGOptic_6x : ItemOptics {};
- class KashtanOptic : ItemOptics {};
- class M68Optic : ItemOptics {};
- class M4_T3NRDSOptic : ItemOptics {};
- class FNP45_MRDSOptic : ItemOptics {};
- class ReflexOptic : ItemOptics {};
- class KobraOptic : ItemOptics {};
- class KazuarOptic: ItemOptics
- {
- override void InitOpticMode() //TODO - decide whether to randomize on spawn and how to determine it (attachment etc.)
- {
- super.InitOpticMode();
-
- SetCurrentOpticMode(GameConstants.OPTICS_STATE_NIGHTVISION);
- }
-
- override int GetCurrentNVType()
- {
- if (IsWorking())
- {
- switch (m_CurrentOpticMode)
- {
- case GameConstants.OPTICS_STATE_DAY:
- return NVTypes.NV_OPTICS_KAZUAR_DAY;
-
- case GameConstants.OPTICS_STATE_NIGHTVISION:
- return NVTypes.NV_OPTICS_KAZUAR_NIGHT;
- }
- Error("Undefined optic mode of " + this);
- return NVTypes.NONE;
- }
- else
- {
- return NVTypes.NV_OPTICS_OFF;
- }
- }
-
- override void OnOpticModeChange()
- {
- super.OnOpticModeChange();
-
- UpdateSelectionVisibility();
- }
-
- override void OnOpticEnter()
- {
- super.OnOpticEnter();
-
- HideSelection("hide_cover_pilot");
- }
-
- override void UpdateSelectionVisibility()
- {
- super.UpdateSelectionVisibility();
-
- switch (GetCurrentOpticMode())
- {
- case GameConstants.OPTICS_STATE_NIGHTVISION:
- HideSelection("hide_cover");
- HideSelection("hide_cover_pilot");
- break;
-
- case GameConstants.OPTICS_STATE_DAY:
- ShowSelection("hide_cover");
- if ( !GetGame().IsDedicatedServer() && !IsInOptics() ) //quick sanity check, just in case
- {
- ShowSelection("hide_cover_pilot");
- }
- break;
- }
- }
-
- override void SetActions()
- {
- super.SetActions();
-
- AddAction(ActionToggleNVMode);
- }
- };
- class StarlightOptic: ItemOptics
- {
- override void InitOpticMode() //TODO - decide whether to randomize on spawn and how to determine it (attachment etc.)
- {
- super.InitOpticMode();
-
- SetCurrentOpticMode(GameConstants.OPTICS_STATE_NIGHTVISION);
- }
-
- override int GetCurrentNVType()
- {
- if (IsWorking())
- {
- switch (m_CurrentOpticMode)
- {
- case GameConstants.OPTICS_STATE_DAY:
- return NVTypes.NV_OPTICS_STARLIGHT_DAY;
-
- case GameConstants.OPTICS_STATE_NIGHTVISION:
- return NVTypes.NV_OPTICS_STARLIGHT_NIGHT;
- }
- Error("Undefined optic mode of " + this);
- return NVTypes.NONE;
- }
- else
- {
- return NVTypes.NV_OPTICS_OFF;
- }
- }
-
- override void OnOpticModeChange()
- {
- super.OnOpticModeChange();
-
- UpdateSelectionVisibility();
- }
-
- override void OnOpticEnter()
- {
- super.OnOpticEnter();
-
- HideSelection("hide_cover_pilot");
- }
-
- override void UpdateSelectionVisibility()
- {
- super.UpdateSelectionVisibility();
-
- switch (GetCurrentOpticMode())
- {
- case GameConstants.OPTICS_STATE_NIGHTVISION:
- HideSelection("hide_cover");
- HideSelection("hide_cover_pilot");
- break;
-
- case GameConstants.OPTICS_STATE_DAY:
- ShowSelection("hide_cover");
- if ( !GetGame().IsDedicatedServer() && !IsInOptics() ) //quick sanity check, just in case
- {
- ShowSelection("hide_cover_pilot");
- }
- break;
- }
- }
-
- override void SetActions()
- {
- super.SetActions();
-
- AddAction(ActionToggleNVMode);
- }
- };
|