Skip to content
EvilEngine.Api.Weapons

IWeaponViewModel interface

public interface IWeaponViewModel

The owner’s view model for the weapon a holder holds, which the weapon changes while it’s out: an ammo counter on the model, a glow as it heats, a stock that folds out. Each change reaches the owner’s client with the body’s state and lasts until it’s changed again or the weapon is put away, when the view model goes back to how its viewmodel record draws it.

Assembly
EvilEngine.Api
Commit
4ff877b1

Members

Skin property

int? Skin { get; set; }

The skin the stack’s driving part draws, the model that plays the weapon’s animations, or null for the record’s own. Below 0, it throws.

Stack property

ContentId? Stack { get; set; }

A viewmodel record drawn in place of the weapon’s own stack, or null for its own. The new stack shows as soon as it’s built, with no lowering and raising, and plays from its idle, so an Animate on the same tick plays on the new stack.

holder.ViewModel.Stack = ContentId.Parse("mygun:viewmodel/unfolded");
holder.Animate("unfold");

Hidden property

bool Hidden { get; set; }

Whether the view model is hidden, as a scope’s view hides it.

Body method

void Body(string group, int? choice)

Picks a choice of a body group by its name on every part whose model has it, or null for the part’s own. Names match whatever their case. Below 0, it throws.

holder.ViewModel.Body("counter", holder.Clip);

Pose method

void Pose(string parameter, double? value)

Sets a pose parameter by name, or null for 0. The parameter drives every blend a part’s animations name it in, as a Source model’s pose parameters do.