public override void OnDeserialize(NetworkReader reader) { base.OnDeserialize(reader); this.soundFrac = reader.ReadSingle(); this.reloadBoost = reader.ReadSingle(); this.chargeBoost = reader.ReadSingle(); this.ammoId = reader.ReadInt32(); this.ammo = SniperAmmoSkillDef.FromID(this.ammoId); this.context = this.ammo.GetContext(); this.context.OnDeserialize(this, reader); }
public override void OnEnter() { base.OnEnter(); if (base.isAuthority) { var data = base.characterBody?.scopeInstanceData; var mod = data.shouldModify ? data?.SendFired() ?? default : default; this.chargeBoost = mod.damageMultiplier; this.soundFrac = mod.charge; this.ammo = base.characterBody.ammo; this.ammoId = ammo.id; this.context = this.ammo.GetContext(); } if (!base.characterMotor.isGrounded) { this.characterMotor.ApplyForce(Vector3.up * this.upBoostForce); } this.context.OnEnter(this); }