@@ -434,23 +434,16 @@ public bool Commandable()
434
434
&& shipState != ShipStateType . Attacking ) ;
435
435
}
436
436
}
437
- public Ship ( int initRadius , ShipType shipType , MoneyPool moneyPool ) :
438
- base ( GameData . PosNotInGame , initRadius , GameObjType . Ship )
437
+ public void Init ( )
439
438
{
440
- CanMove . SetROri ( false ) ;
441
- IsRemoved . SetROri ( true ) ;
442
- Occupation = OccupationFactory . FindIOccupation ( ShipType = shipType ) ;
443
- ViewRange = Occupation . ViewRange ;
444
- HP = new ( Occupation . MaxHp ) ;
445
- Armor = new ( Occupation . BaseArmor ) ;
446
- Shield = new ( Occupation . BaseShield ) ;
439
+ HP . SetMaxV ( Occupation . MaxHp ) ;
440
+ HP . SetVToMaxV ( ) ;
441
+ Armor . SetMaxV ( Occupation . BaseArmor ) ;
442
+ Armor . SetVToMaxV ( ) ;
443
+ Shield . SetMaxV ( Occupation . BaseShield ) ;
444
+ Shield . SetVToMaxV ( ) ;
447
445
MoveSpeed . SetROri ( orgMoveSpeed = Occupation . MoveSpeed ) ;
448
- MoneyPool = moneyPool ;
449
-
450
- ProducerType producerType ;
451
- ConstructorType constructorType ;
452
- WeaponType weaponType ;
453
- ( producerType , constructorType , weaponType ) = ShipType switch
446
+ var ( producerType , constructorType , weaponType ) = ShipType switch
454
447
{
455
448
ShipType . CivilShip => (
456
449
ProducerType . Producer1 ,
@@ -475,4 +468,17 @@ public Ship(int initRadius, ShipType shipType, MoneyPool moneyPool) :
475
468
ShieldModule . SetROri ( ModuleFactory . FindIShield ( ShipType , ShieldType . Null ) ) ;
476
469
WeaponModule . SetROri ( ModuleFactory . FindIWeapon ( ShipType , weaponType ) ) ;
477
470
}
471
+ public Ship ( int initRadius , ShipType shipType , MoneyPool moneyPool ) :
472
+ base ( GameData . PosNotInGame , initRadius , GameObjType . Ship )
473
+ {
474
+ CanMove . SetROri ( false ) ;
475
+ IsRemoved . SetROri ( true ) ;
476
+ Occupation = OccupationFactory . FindIOccupation ( ShipType = shipType ) ;
477
+ ViewRange = Occupation . ViewRange ;
478
+ HP = new ( Occupation . MaxHp ) ;
479
+ Armor = new ( Occupation . BaseArmor ) ;
480
+ Shield = new ( Occupation . BaseShield ) ;
481
+ MoneyPool = moneyPool ;
482
+ Init ( ) ;
483
+ }
478
484
}
0 commit comments