programming-game
Version:
The client for programming game, an mmorpg that you interact with entirely through code.
66 lines (65 loc) • 2.31 kB
TypeScript
import { OffhandEquipmentType, WeaponType } from "./items";
import { AppliesMechanics, ClientSideUnit, StatusEffectName } from "./types";
export type WeaponSkill = "doubleSlash" | "pinningShot" | "misdirectingShot" | "combo" | "haymaker" | "headbutt" | "charge" | "powerSlash" | "shieldCharge" | "threaten";
type WeaponSkillOptions<S extends WeaponSkill, ClientOptions, ServerOptions> = {
client: {
skill: S;
target: ClientSideUnit;
options?: ClientOptions;
} & (ClientOptions extends undefined ? {
options?: undefined;
} : {
options: ClientOptions;
});
server: {
skill: S;
target: string;
options?: ServerOptions;
} & (ServerOptions extends undefined ? {
options?: undefined;
} : {
options: ServerOptions;
});
};
export type WeaponSkillSpecifics = {
misdirectingShot: WeaponSkillOptions<"misdirectingShot", {
to: ClientSideUnit;
}, {
to: string;
}>;
doubleSlash: WeaponSkillOptions<"doubleSlash", undefined, undefined>;
powerSlash: WeaponSkillOptions<"powerSlash", undefined, undefined>;
pinningShot: WeaponSkillOptions<"pinningShot", undefined, undefined>;
combo: WeaponSkillOptions<"combo", undefined, undefined>;
haymaker: WeaponSkillOptions<"haymaker", undefined, undefined>;
headbutt: WeaponSkillOptions<"headbutt", undefined, undefined>;
charge: WeaponSkillOptions<"charge", undefined, undefined>;
shieldCharge: WeaponSkillOptions<"shieldCharge", undefined, undefined>;
threaten: WeaponSkillOptions<"threaten", undefined, undefined>;
};
export type WeaponSkillDefinition = {
id: WeaponSkill;
name: string;
tpCost: number;
weaponType?: WeaponType | OffhandEquipmentType | "unarmed";
target?: string;
minRange?: number;
maxRange?: number;
mechanics?: {
damageMultiplier?: number;
attackMultiplier?: number;
threat?: number;
};
selfEffects?: {
duration: number;
effect: StatusEffectName;
mechanics: AppliesMechanics;
};
targetEffects?: {
duration: number;
effect: StatusEffectName;
mechanics: AppliesMechanics;
};
};
export declare const weaponSkills: Record<WeaponSkill, WeaponSkillDefinition>;
export {};