Merge branch 'develop' into force-landscape

This commit is contained in:
ntr 2019-11-05 12:35:27 +11:00
commit 06a62ca3ae
21 changed files with 214 additions and 120 deletions

View File

@ -1 +1 @@
1.7.0 1.7.1

View File

@ -36,7 +36,6 @@
- Strike + SpeedRR -> StrikeSpeed (strike has Y% more speed) - Strike + SpeedRR -> StrikeSpeed (strike has Y% more speed)
- Strike + LifeRR -> StrikeLife (Strike recharges X% of damage as red life) - Strike + LifeRR -> StrikeLife (Strike recharges X% of damage as red life)
* equip from shop (buy and equip without putting in your inventory) for bases
* move item from one construct to another * move item from one construct to another
* ACP * ACP
@ -89,7 +88,6 @@ $$$
* Highlight (dota) colour * Highlight (dota) colour
* fx colours + styles * fx colours + styles
* ??? (PROBS NOT) drag and drop buy / equip / unequip items ???
* modules * modules
* troll life -> dmg * troll life -> dmg
* prince of peace * prince of peace

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.7.0", "version": "1.7.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -203,6 +203,9 @@
button { button {
height: 3em; height: 3em;
} }
label {
display: flex;
}
} }
.specs { .specs {
@ -228,6 +231,10 @@
// font-size: 75%; // font-size: 75%;
line-height: initial; line-height: initial;
} }
label {
display: flex;
}
} }
.stats { .stats {

View File

@ -83,7 +83,7 @@
&.highlight { &.highlight {
color: black; color: black;
background: @white; background: @white;
border: 1px solid @white; // border: 1px solid @white; (this bangs around the vbox)
// overwrite the classes on white svg elements // overwrite the classes on white svg elements
svg { svg {

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.7.0", "version": "1.7.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1,4 +1,5 @@
module.exports = { // This will need to be edited if we change server recipes // This will need to be edited if we change server recipes
module.exports = {
// Attack // Attack
Strike: () => 'red-border', Strike: () => 'red-border',
Blast: () => 'blue-border', Blast: () => 'blue-border',
@ -7,7 +8,7 @@ module.exports = { // This will need to be edited if we change server recipes
Slay: () => 'red-green-border', Slay: () => 'red-green-border',
Siphon: () => 'blue-green-border', Siphon: () => 'blue-green-border',
// Stun // Stun
Link: () => 'blue-greenborder', Link: () => 'blue-green-border',
Bash: () => 'red-border', Bash: () => 'red-border',
Sleep: () => 'green-border', Sleep: () => 'green-border',
Ruin: () => 'blue-border', Ruin: () => 'blue-border',
@ -31,9 +32,9 @@ module.exports = { // This will need to be edited if we change server recipes
Restrict: () => 'red-border', Restrict: () => 'red-border',
Purge: () => 'green-border', Purge: () => 'green-border',
Silence: () => 'blue-border', Silence: () => 'blue-border',
Curse: () => 'red-green-border', Invert: () => 'red-green-border',
Decay: () => 'blue-green-border', Decay: () => 'blue-green-border',
Invert: () => 'red-blue-border', Curse: () => 'red-blue-border',
// // Lifes Upgrades // // Lifes Upgrades
// LifeGG: () => 'green-border', // LifeGG: () => 'green-border',

View File

@ -20,9 +20,15 @@ const addState = connect(
account, account,
itemInfo, itemInfo,
itemEquip, itemEquip,
itemUnequip,
vboxSelected,
tutorial, tutorial,
} = state; } = state;
function sendVboxAcceptEquip(constructId) {
return ws.sendVboxAcceptEquip(instance.id, vboxSelected[0], vboxSelected[1], constructId);
}
function sendVboxApply(constructId, i) { function sendVboxApply(constructId, i) {
return ws.sendVboxApply(instance.id, constructId, i); return ws.sendVboxApply(instance.id, constructId, i);
} }
@ -31,14 +37,22 @@ const addState = connect(
return ws.sendVboxUnequip(instance.id, constructId, item); return ws.sendVboxUnequip(instance.id, constructId, item);
} }
function sendVboxUnequipApply(targetConstructId) {
return ws.sendVboxUnequipApply(instance.id, itemUnequip[0], itemUnequip[1], targetConstructId);
}
return { return {
instance, instance,
player, player,
account, account,
sendVboxAcceptEquip,
sendVboxUnequipApply,
sendVboxApply, sendVboxApply,
itemInfo, itemInfo,
itemEquip, itemEquip,
itemUnequip,
sendUnequip, sendUnequip,
vboxSelected,
tutorial, tutorial,
}; };
}, },
@ -75,20 +89,23 @@ function Construct(props) {
construct, construct,
iter, iter,
itemEquip, itemEquip,
itemUnequip,
instance, instance,
player, player,
vboxSelected,
tutorial, tutorial,
// Static Info // Static Info
itemInfo, itemInfo,
// Function Calls // Function Calls
sendVboxApply, sendVboxApply,
sendVboxAcceptEquip,
sendVboxUnequipApply,
sendUnequip, sendUnequip,
setActiveConstruct, setActiveConstruct,
setItemUnequip, setItemUnequip,
setItemEquip, setItemEquip,
setInfo, setInfo,
} = props; } = props;
const { vbox } = player; const { vbox } = player;
const duplicateSkill = construct.skills.length !== 0 && construct.skills.every(sk => { const duplicateSkill = construct.skills.length !== 0 && construct.skills.every(sk => {
@ -97,14 +114,16 @@ function Construct(props) {
return sk.skill === vbox.bound[itemEquip]; return sk.skill === vbox.bound[itemEquip];
}); });
const tutorialDisableEquip = tutorialShouldDisableEquip(tutorial, iter, instance, construct); const tutorialDisableEquip = tutorialShouldDisableEquip(tutorial, iter, instance, construct);
function onClick(e) { function onClick(e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
if (duplicateSkill || tutorialDisableEquip) return true; if (duplicateSkill || tutorialDisableEquip) return true;
if (itemEquip !== null) sendVboxApply(construct.id, itemEquip); if (itemEquip !== null) return sendVboxApply(construct.id, itemEquip);
if (vboxSelected[0]) return sendVboxAcceptEquip(construct.id);
if (itemUnequip.length && itemUnequip[0] !== construct.id) return sendVboxUnequipApply(construct.id);
setItemEquip(null); setItemEquip(null);
return setActiveConstruct(construct); setItemUnequip([]);
return true;
} }
function hoverInfo(e, info) { function hoverInfo(e, info) {
@ -151,15 +170,20 @@ function Construct(props) {
const classes = `${equipping ? 'equipping' : ''} ${!skill ? 'empty' : ''} ${border()}`; const classes = `${equipping ? 'equipping' : ''} ${!skill ? 'empty' : ''} ${border()}`;
return ( return (
<button <label onDragStart={ev => {
key={i} ev.dataTransfer.setData('text', '');
disabled={!skill && !equipping} skillClick(ev);
class={classes} }} key={i} draggable="true" onDragEnd={() => setItemUnequip([])}>
onClick={skillClick} <button
onDblClick={skillDblClick} key={i}
onMouseOver={e => hoverInfo(e, skill && skill.skill)} > disabled={!skill && !equipping}
{s} class={classes}
</button> onClick={skillClick}
onDblClick={skillDblClick}
onMouseOver={e => hoverInfo(e, skill && skill.skill)} >
{s}
</button>
</label>
); );
}); });
@ -193,13 +217,15 @@ function Construct(props) {
return ( return (
<button <label onDragStart={specClick} key={i} draggable="true" onDragEnd={() => setItemUnequip([])}>
key={i} <button
onClick={specClick} key={i}
onDblClick={specDblClick} onClick={specClick}
onMouseOver={e => hoverInfo(e, s)} > onDblClick={specDblClick}
{shapes[s]()} onMouseOver={e => hoverInfo(e, s)} >
</button> {shapes[s]()}
</button>
</label>
); );
}); });
@ -221,7 +247,7 @@ function Construct(props) {
const classes = `instance-construct`; const classes = `instance-construct`;
const avatarMouseOver = e => hoverInfo(e, `constructAvatar ${construct.name}`); const avatarMouseOver = e => hoverInfo(e, `constructAvatar ${construct.name}`);
return ( return (
<div key={construct.id} class={classes} onClick={onClick}> <div key={construct.id} class={classes} onClick={onClick} onDragOver={ev => ev.preventDefault()} onDrop={onClick}>
<ConstructAvatar construct={construct} mouseOver={avatarMouseOver}/> <ConstructAvatar construct={construct} mouseOver={avatarMouseOver}/>
<h2 class="name" onMouseOver={e => hoverInfo(e, `constructName ${construct.name}`)}>{construct.name}</h2> <h2 class="name" onMouseOver={e => hoverInfo(e, `constructName ${construct.name}`)}>{construct.name}</h2>
<div class="skills" onMouseOver={e => hoverInfo(e, 'constructSkills')} > <div class="skills" onMouseOver={e => hoverInfo(e, 'constructSkills')} >
@ -240,10 +266,12 @@ function Construct(props) {
class InstanceConstructs extends preact.Component { class InstanceConstructs extends preact.Component {
shouldComponentUpdate(newProps) { shouldComponentUpdate(newProps) {
if (newProps.itemEquip !== this.props.itemEquip) return true; if (newProps.itemEquip !== this.props.itemEquip) return true;
if (newProps.itemUnequip !== this.props.itemUnequip) return true;
if (newProps.tutorial !== this.props.tutorial) return true; if (newProps.tutorial !== this.props.tutorial) return true;
// JSON or Array objects // JSON or Array objects
if (newProps.player !== this.props.player) return true; if (newProps.player !== this.props.player) return true;
if (newProps.instance !== this.props.instance) return true; if (newProps.instance !== this.props.instance) return true;
if (newProps.vboxSelected !== this.props.vboxSelected) return true;
return false; return false;
} }
@ -251,15 +279,19 @@ class InstanceConstructs extends preact.Component {
const { const {
// Changing state variables // Changing state variables
itemEquip, itemEquip,
itemUnequip,
instance, instance,
player, player,
tutorial, tutorial,
vboxSelected,
// Static data // Static data
itemInfo, itemInfo,
// Function calls // Function calls
setInfo, setInfo,
setActiveConstruct, setActiveConstruct,
sendVboxApply, sendVboxApply,
sendVboxAcceptEquip,
sendVboxUnequipApply,
setVboxHighlight, setVboxHighlight,
setItemUnequip, setItemUnequip,
setItemEquip, setItemEquip,
@ -277,16 +309,20 @@ class InstanceConstructs extends preact.Component {
iter: i, iter: i,
construct: player.constructs[i], construct: player.constructs[i],
itemEquip, itemEquip,
itemUnequip,
instance, instance,
setItemUnequip, setItemUnequip,
setItemEquip, setItemEquip,
player, player,
sendVboxApply, sendVboxApply,
sendVboxAcceptEquip,
sendVboxUnequipApply,
setInfo, setInfo,
setActiveConstruct, setActiveConstruct,
itemInfo, itemInfo,
setVboxHighlight, setVboxHighlight,
sendUnequip, sendUnequip,
vboxSelected,
tutorial, tutorial,
}); });
}); });

View File

@ -28,6 +28,7 @@ const addState = connect(
} }
function sendVboxAccept(group, index) { function sendVboxAccept(group, index) {
document.activeElement.blur();
return ws.sendVboxAccept(instance.id, group, index); return ws.sendVboxAccept(instance.id, group, index);
} }
@ -190,8 +191,6 @@ class Vbox extends preact.Component {
e.stopPropagation(); e.stopPropagation();
setItemEquip(null); setItemEquip(null);
setCombiner([]); setCombiner([]);
if (selected) return clearVboxSelected();
setInfo(vbox.free[group][index]); setInfo(vbox.free[group][index]);
return setVboxSelected([group, index]); return setVboxSelected([group, index]);
} }
@ -213,28 +212,20 @@ class Vbox extends preact.Component {
const classes = `${v.toLowerCase()} ${selected ? 'highlight' : ''} ${comboHighlight}`; const classes = `${v.toLowerCase()} ${selected ? 'highlight' : ''} ${comboHighlight}`;
if (shapes[v]) { const vboxObject = shapes[v] ? shapes[v]() : v;
return ( return (
<label draggable='true'
onDragStart={ev => ev.dataTransfer.setData('text', '')}
onDragEnd={clearVboxSelected}>
<button <button
class={classes} class={classes}
onMouseOver={e => vboxHover(e, v)} onMouseOver={e => vboxHover(e, v)}
onMouseDown={onClick} onMouseDown={onClick}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
onDblClick={onDblClick} > onDblClick={onDblClick}
{shapes[v]()} > {vboxObject}
</button> </button>
); </label>
}
return (
<button
class={classes}
onMouseDown={onClick}
onClick={e => e.stopPropagation()}
onDblClick={onDblClick}
onMouseOver={e => vboxHover(e, v)}>
{v}
</button>
); );
} }
@ -314,7 +305,8 @@ class Vbox extends preact.Component {
// removing // removing
const combinerIndex = combiner.indexOf(i); const combinerIndex = combiner.indexOf(i);
if (combinerIndex > -1) { if (combinerIndex > -1) {
return combinerChange(without(combiner, i)); return true;
// return combinerChange(without(combiner, i));
} }
combiner.push(i); combiner.push(i);
@ -330,26 +322,22 @@ class Vbox extends preact.Component {
const highlighted = combiner.indexOf(i) > -1; const highlighted = combiner.indexOf(i) > -1;
const border = buttons[removeTier(v)] ? buttons[removeTier(v)]() : ''; const border = buttons[removeTier(v)] ? buttons[removeTier(v)]() : '';
const classes = `${highlighted ? 'highlight' : border} ${comboHighlight}`; const classes = `${highlighted ? 'highlight' : border} ${comboHighlight}`;
if (shapes[v]) {
return ( const invObject = shapes[v] ? shapes[v]() : v;
return (
<label
draggable='true'
onDragStart={ev => ev.dataTransfer.setData('text', '')}
onDragEnd={() => combinerChange([])}>
<button <button
class={classes} class={classes}
onMouseOver={e => vboxHover(e, v)} onMouseOver={e => vboxHover(e, v)}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
onMouseDown={onClick}> onMouseDown={onClick}>
{shapes[v]()} {invObject}
</button> </button>
); </label>
}
return (
<button
class={classes}
onMouseDown={onClick}
onClick={e => e.stopPropagation()}
onMouseOver={e => vboxHover(e, v)}>
{v}
</button>
); );
} }
@ -404,7 +392,10 @@ class Vbox extends preact.Component {
<div class={inventoryClass} <div class={inventoryClass}
onMouseDown={inventoryClick} onMouseDown={inventoryClick}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
style={vboxSelecting || (itemUnequip.length) ? { cursor: 'pointer' } : null}> style={vboxSelecting || (itemUnequip.length) ? { cursor: 'pointer' } : null}
onDragOver={ev => ev.preventDefault()}
onDrop={inventoryClick}
>
<div class="vbox-hdr"> <div class="vbox-hdr">
<h3 <h3
onTouchStart={e => e.target.scrollIntoView(true)} onTouchStart={e => e.target.scrollIntoView(true)}

View File

@ -190,6 +190,7 @@ function registerEvents(store) {
store.dispatch(actions.setItemEquip(null)); store.dispatch(actions.setItemEquip(null));
store.dispatch(actions.setItemUnequip([])); store.dispatch(actions.setItemUnequip([]));
store.dispatch(actions.setVboxHighlight([])); store.dispatch(actions.setVboxHighlight([]));
store.dispatch(actions.setVboxSelected([]));
} }
function setAccountInstances(v) { function setAccountInstances(v) {

View File

@ -82,6 +82,11 @@ function createSocket(events) {
events.clearInstance(); events.clearInstance();
} }
function sendVboxAcceptEquip(instanceId, group, index, constructId) {
send(['VboxAcceptEquip', { instance_id: instanceId, group, index, construct_id: constructId }]);
events.clearInstance();
}
function sendVboxApply(instanceId, constructId, index) { function sendVboxApply(instanceId, constructId, index) {
send(['VboxApply', { instance_id: instanceId, construct_id: constructId, index }]); send(['VboxApply', { instance_id: instanceId, construct_id: constructId, index }]);
events.clearInstance(); events.clearInstance();
@ -92,6 +97,11 @@ function createSocket(events) {
events.clearInstance(); events.clearInstance();
} }
function sendVboxUnequipApply(instanceId, constructId, target, targetConstructId) {
send(['VboxUnequipApply', { instance_id: instanceId, construct_id: constructId, target, target_construct_id: targetConstructId }]);
events.clearInstance();
}
function sendVboxDiscard(instanceId) { function sendVboxDiscard(instanceId) {
send(['VboxDiscard', { instance_id: instanceId }]); send(['VboxDiscard', { instance_id: instanceId }]);
events.clearInstance(); events.clearInstance();
@ -99,7 +109,7 @@ function createSocket(events) {
function sendVboxCombine(instanceId, indices) { function sendVboxCombine(instanceId, indices) {
send(['VboxCombine', { instance_id: instanceId, indices }]); send(['VboxCombine', { instance_id: instanceId, indices }]);
events.clearCombiner(); events.clearInstance();
} }
function sendVboxReclaim(instanceId, index) { function sendVboxReclaim(instanceId, index) {
@ -382,11 +392,13 @@ function createSocket(events) {
sendInstanceChat, sendInstanceChat,
sendVboxAccept, sendVboxAccept,
sendVboxAcceptEquip,
sendVboxApply, sendVboxApply,
sendVboxReclaim, sendVboxReclaim,
sendVboxCombine, sendVboxCombine,
sendVboxDiscard, sendVboxDiscard,
sendVboxUnequip, sendVboxUnequip,
sendVboxUnequipApply,
sendItemInfo, sendItemInfo,

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-ops", "name": "mnml-ops",
"version": "1.7.0", "version": "1.7.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mnml" name = "mnml"
version = "1.7.0" version = "1.7.1"
authors = ["ntr <ntr@smokestack.io>"] authors = ["ntr <ntr@smokestack.io>"]
[dependencies] [dependencies]

View File

@ -67,13 +67,13 @@ pub fn select(db: &Db, id: Uuid) -> Result<Account, Error> {
pub fn chat_wheel(_db: &Db, _id: Uuid) -> Result<Vec<String>, Error> { pub fn chat_wheel(_db: &Db, _id: Uuid) -> Result<Vec<String>, Error> {
return Ok(vec![ return Ok(vec![
"gl".to_string(),
"hf".to_string(),
"gg".to_string(), "gg".to_string(),
"thx".to_string(), "glhf".to_string(),
"nice".to_string(),
"hmm".to_string(), "hmm".to_string(),
"ok".to_string(), "ok".to_string(),
"rekt".to_string(),
"thx".to_string(),
"nice".to_string(),
"...".to_string(), "...".to_string(),
]) ])
} }

View File

@ -274,6 +274,10 @@ pub fn smile(id: Uuid) -> Result<Uuid, Error> {
("M0,0 L50,25 M50,0 L0,25", 1), // x ("M0,0 L50,25 M50,0 L0,25", 1), // x
("M0,0 L50,12.5 L0,25", 1), // > ("M0,0 L50,12.5 L0,25", 1), // >
("M50,0 L0,12.5 L50,25", 1), // < ("M50,0 L0,12.5 L50,25", 1), // <
("M0,0 L0,25 L50,25", 1), // L
("M50,0 L50,25 L0,25", 1), // J
("M0,0 L50,0 M50,6.25 L50,12.5 M50,18.75 L50,25", 1), // ;
("M12.5,0 L37.5,0 L37.5,25 L12.5,25 L12.5,0", 1), // o
]; ];
let eye_left_dist = WeightedIndex::new(eyes_left.iter().map(|v| v.1))?; let eye_left_dist = WeightedIndex::new(eyes_left.iter().map(|v| v.1))?;
@ -283,10 +287,14 @@ pub fn smile(id: Uuid) -> Result<Uuid, Error> {
("M150,0 L175,25 L200,0", 1), // v ("M150,0 L175,25 L200,0", 1), // v
("M150,25 L175,0 L200,25", 1), // ^ ("M150,25 L175,0 L200,25", 1), // ^
("M150,0 L200,0", 1), // - ("M150,0 L200,0", 1), // -
("M150,25 L200,25", 1), // - ("M150,25 L200,25", 1), // _
("M150,0 L200,25 M200,0 L150,25", 1), // x ("M150,0 L200,25 M200,0 L150,25", 1), // x
("M150,0 L200,12.5 L150,25", 1), // > ("M150,0 L200,12.5 L150,25", 1), // >
("M200,0 L150,12.5 L200,25", 1), // < ("M200,0 L150,12.5 L200,25", 1), // <
("M150,0 L150,25 L200,25", 1), // L
("M200,0 L200,25 L150,25", 1), // J
("M150,0 L200,0 M150,6.25 L150,12.5 M150,18.75 L150,25", 1), // ;
("M162.5,0 L187.5,0 L187.5,25 L162.5,25 L162.5,0", 1), // o
]; ];
let eye_right_dist= WeightedIndex::new(eyes_right.iter().map(|v| v.1))?; let eye_right_dist= WeightedIndex::new(eyes_right.iter().map(|v| v.1))?;
@ -297,8 +305,15 @@ pub fn smile(id: Uuid) -> Result<Uuid, Error> {
("M50,75 L150,75 L150,100 L50,100 L50,75", 1), // box ("M50,75 L150,75 L150,100 L50,100 L50,75", 1), // box
("M50,75 L75,100 L100,75 L125,100 L150,75", 1), // w ("M50,75 L75,100 L100,75 L125,100 L150,75", 1), // w
("M50,75 L75,75 L75,87.5 M75,75 L125,75 L125,87.5 M125,75 L150,75", 1), // vamp ("M50,75 L75,75 L75,87.5 M75,75 L125,75 L125,87.5 M125,75 L150,75", 1), // vamp
("M50,75 L150,75 M50,75 L50,87.5 M75,75 L75,87.5 M100,75 L100,87.5 M125,75 L125,87.5 M150,75 L150,87.5", 1), // mm
("M75,75 L125,75 L125,100 L75,100 L75,75", 1), // o ("M75,75 L125,75 L125,100 L75,100 L75,75", 1), // o
("M50,75 L150,100 M150,75 L50,100", 1), // x ("M50,75 L150,100 M150,75 L50,100", 1), // x
("M50,75 L150,75 L150,100 L125,100 L125,75", 1), // p
("M50,75 L150,75 M50,75 L50,100 L75,100 L75,75", 1), // d
// ("M50,75 L50,100 L150,100 L150,75", 1), // u
("M50,100 L50,75 L150,75 L150,100", 1), // n
("M50,75 L50,100 L150,75 L150,100", 1), // Z
("M50,87.5 L100,75 L150,87.5 L100,100 L50,87.5", 1), // Z
]; ];
let mouth_dist = WeightedIndex::new(mouths.iter().map(|v| v.1))?; let mouth_dist = WeightedIndex::new(mouths.iter().map(|v| v.1))?;

View File

@ -473,10 +473,10 @@ impl Instance {
Ok(self) Ok(self)
} }
pub fn vbox_accept(mut self, account: Uuid, group: usize, index: usize) -> Result<Instance, Error> { pub fn vbox_accept(mut self, account: Uuid, group: usize, index: usize, construct_id: Option<Uuid>) -> Result<Instance, Error> {
self.vbox_action_allowed(account)?; self.vbox_action_allowed(account)?;
self.account_player(account)? self.account_player(account)?
.vbox_accept(group, index)?; .vbox_accept(group, index, construct_id)?;
Ok(self) Ok(self)
} }
@ -501,10 +501,10 @@ impl Instance {
Ok(self) Ok(self)
} }
pub fn vbox_unequip(mut self, account: Uuid, target: Item, construct_id: Uuid) -> Result<Instance, Error> { pub fn vbox_unequip(mut self, account: Uuid, target: Item, construct_id: Uuid, target_construct_id: Option<Uuid>) -> Result<Instance, Error> {
self.vbox_action_allowed(account)?; self.vbox_action_allowed(account)?;
self.account_player(account)? self.account_player(account)?
.vbox_unequip(target, construct_id)?; .vbox_unequip(target, construct_id, target_construct_id)?;
Ok(self) Ok(self)
} }
} }

View File

@ -620,70 +620,70 @@ impl Item {
// Lifes Upgrades // Lifes Upgrades
Item::LifeGG | Item::LifeGG |
Item::LifeGGPlus | Item::LifeGGPlus |
Item::LifeGGPlusPlus => format!("Increases construct GreenLife by {:?}. Item::LifeGGPlusPlus => format!("Increases construct GreenLife by {:?}.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::LifeRR | Item::LifeRR |
Item::LifeRRPlus | Item::LifeRRPlus |
Item::LifeRRPlusPlus => format!("Increases construct RedLife by {:?}. Item::LifeRRPlusPlus => format!("Increases construct RedLife by {:?}.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::LifeBB | Item::LifeBB |
Item::LifeBBPlus | Item::LifeBBPlus |
Item::LifeBBPlusPlus => format!("Increases construct BlueLife by {:?}. Item::LifeBBPlusPlus => format!("Increases construct BlueLife by {:?}.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::LifeRG | Item::LifeRG |
Item::LifeRGPlus | Item::LifeRGPlus |
Item::LifeRGPlusPlus => format!("Increases construct RedLife and GreenLife by {:?}. Item::LifeRGPlusPlus => format!("Increases construct RedLife and GreenLife by {:?}.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::LifeGB | Item::LifeGB |
Item::LifeGBPlus | Item::LifeGBPlus |
Item::LifeGBPlusPlus => format!("Increases construct GreenLife and BlueLife by {:?}. Item::LifeGBPlusPlus => format!("Increases construct GreenLife and BlueLife by {:?}.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::LifeRB | Item::LifeRB |
Item::LifeRBPlus | Item::LifeRBPlus |
Item::LifeRBPlusPlus => format!("Increases construct RedLife and BlueLife by {:?}. Item::LifeRBPlusPlus => format!("Increases construct RedLife and BlueLife by {:?}.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
// Power Upgrades // Power Upgrades
Item::PowerRR | Item::PowerRR |
Item::PowerRRPlus | Item::PowerRRPlus |
Item::PowerRRPlusPlus => format!("Increases construct RedPower by {:?}%. Item::PowerRRPlusPlus => format!("Increases construct RedPower by {:?}%.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::PowerBB | Item::PowerBB |
Item::PowerBBPlus | Item::PowerBBPlus |
Item::PowerBBPlusPlus => format!("Increases construct BluePower by {:?}%. Item::PowerBBPlusPlus => format!("Increases construct BluePower by {:?}%.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::PowerGG | Item::PowerGG |
Item::PowerGGPlus | Item::PowerGGPlus |
Item::PowerGGPlusPlus => format!("Increases construct GreenPower by {:?}%. Item::PowerGGPlusPlus => format!("Increases construct GreenPower by {:?}%.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::PowerRG | Item::PowerRG |
Item::PowerRGPlus | Item::PowerRGPlus |
Item::PowerRGPlusPlus => format!("Increases construct GreenPower and RedPower by {:?}%. Item::PowerRGPlusPlus => format!("Increases construct GreenPower and RedPower by {:?}%.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::PowerGB | Item::PowerGB |
Item::PowerGBPlus | Item::PowerGBPlus |
Item::PowerGBPlusPlus => format!("Increases construct GreenPower and BluePower by {:?}%. Item::PowerGBPlusPlus => format!("Increases construct GreenPower and BluePower by {:?}%.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
Item::PowerRB | Item::PowerRB |
Item::PowerRBPlus | Item::PowerRBPlus |
Item::PowerRBPlusPlus => format!("Increases construct RedPower and BluePower by {:?}%. Item::PowerRBPlusPlus => format!("Increases construct RedPower and BluePower by {:?}%.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
@ -705,7 +705,7 @@ impl Item {
Item::SpeedGGPlusPlus | Item::SpeedGGPlusPlus |
Item::SpeedRGPlusPlus | Item::SpeedRGPlusPlus |
Item::SpeedGBPlusPlus | Item::SpeedGBPlusPlus |
Item::SpeedRBPlusPlus => format!("Increases construct SpeedStat by {:?}%. Item::SpeedRBPlusPlus => format!("Increases construct SpeedStat by {:?}%.
If your team meets total colour thresholds the spec provides additional bonuses.", If your team meets total colour thresholds the spec provides additional bonuses.",
self.into_spec().unwrap().values().base()), self.into_spec().unwrap().values().base()),
@ -796,7 +796,7 @@ impl Item {
Item::Hybrid| Item::Hybrid|
Item::HybridPlus | Item::HybridPlus |
Item::HybridPlusPlus => format!( Item::HybridPlusPlus => format!(
"Hybrid increases GreenPower by {:?}%. "Hybrid increases GreenPower by {:?}%.
Blue based Attack skills will blast again dealing {:?}% GreenPower as blue damage. Blue based Attack skills will blast again dealing {:?}% GreenPower as blue damage.
Lasts {:?}T.", Lasts {:?}T.",
self.into_skill().unwrap().effect()[0].get_multiplier() - 100, self.into_skill().unwrap().effect()[0].get_multiplier() - 100,
@ -823,7 +823,7 @@ impl Item {
Item::Purge| Item::Purge|
Item::PurgePlus | Item::PurgePlus |
Item::PurgePlusPlus => format!( Item::PurgePlusPlus => format!(
"Remove buffs from target construct. "Remove buffs from target construct.
Applies purge disabling target green skills for {:?}T.", Applies purge disabling target green skills for {:?}T.",
self.into_skill().unwrap().effect()[0].get_duration()), self.into_skill().unwrap().effect()[0].get_duration()),
@ -836,7 +836,7 @@ impl Item {
Item::Reflect| Item::Reflect|
Item::ReflectPlus | Item::ReflectPlus |
Item::ReflectPlusPlus => format!( Item::ReflectPlusPlus => format!(
"Reflect incoming blue skills to source. Lasts {:?}T. "Reflect incoming blue skills to source. Lasts {:?}T.
Recharges target BlueLife based on {:?}% BluePower.", Recharges target BlueLife based on {:?}% BluePower.",
self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().effect()[0].get_duration(),
self.into_skill().unwrap().multiplier()), self.into_skill().unwrap().multiplier()),
@ -943,6 +943,11 @@ impl Item {
} }
} }
// !!!!!!
// IF YOU CHANGE A COMBO
// BE SURE TO EDIT BUTTONS.JSX TOO
// !!!!!!
fn combo(&self) -> Vec<Item> { fn combo(&self) -> Vec<Item> {
match self { match self {
Item::Intercept => vec![Item::Buff, Item::Red, Item::Red], Item::Intercept => vec![Item::Buff, Item::Red, Item::Red],

View File

@ -256,8 +256,12 @@ impl Player {
Ok(self) Ok(self)
} }
pub fn vbox_accept(&mut self, group: usize, index: usize) -> Result<&mut Player, Error> { pub fn vbox_accept(&mut self, group: usize, index: usize, construct_id: Option<Uuid>) -> Result<&mut Player, Error> {
self.vbox.accept(group, index)?; self.vbox.accept(group, index, construct_id)?;
if construct_id.is_some() {
let equip_index = self.vbox.bound.len() - 1;
self.vbox_apply(equip_index, construct_id.expect("no construct"))?;
}
Ok(self) Ok(self)
} }
@ -320,8 +324,8 @@ impl Player {
Ok(self) Ok(self)
} }
pub fn vbox_unequip(&mut self, target: Item, construct_id: Uuid) -> Result<&mut Player, Error> { pub fn vbox_unequip(&mut self, target: Item, construct_id: Uuid, target_construct_id: Option<Uuid>) -> Result<&mut Player, Error> {
if self.vbox.bound.len() >= 9 { if self.vbox.bound.len() >= 9 && !target_construct_id.is_some() {
return Err(err_msg("too many items bound")); return Err(err_msg("too many items bound"));
} }
@ -354,7 +358,12 @@ impl Player {
} }
self.vbox.bound.push(target); self.vbox.bound.push(target);
self.vbox.bound.sort_unstable();
if target_construct_id.is_some() {
let equip_index = self.vbox.bound.len() - 1;
self.vbox_apply(equip_index, target_construct_id.expect("no construct"))?;
}
// self.vbox.bound.sort_unstable();
Ok(self) Ok(self)
} }

View File

@ -1,6 +1,5 @@
use std::time::{Instant}; use std::time::{Instant};
use std::thread::{spawn, sleep}; use std::thread::{spawn};
use std::time;
use std::str; use std::str;
@ -113,10 +112,12 @@ pub enum RpcRequest {
InstanceChat { instance_id: Uuid, index: usize }, InstanceChat { instance_id: Uuid, index: usize },
VboxAccept { instance_id: Uuid, group: usize, index: usize }, VboxAccept { instance_id: Uuid, group: usize, index: usize },
VboxAcceptEquip { instance_id: Uuid, group: usize, index: usize, construct_id: Uuid },
VboxDiscard { instance_id: Uuid }, VboxDiscard { instance_id: Uuid },
VboxCombine { instance_id: Uuid, indices: Vec<usize> }, VboxCombine { instance_id: Uuid, indices: Vec<usize> },
VboxApply { instance_id: Uuid, construct_id: Uuid, index: usize }, VboxApply { instance_id: Uuid, construct_id: Uuid, index: usize },
VboxUnequip { instance_id: Uuid, construct_id: Uuid, target: Item }, VboxUnequip { instance_id: Uuid, construct_id: Uuid, target: Item },
VboxUnequipApply { instance_id: Uuid, construct_id: Uuid, target: Item, target_construct_id: Uuid },
VboxReclaim { instance_id: Uuid, index: usize }, VboxReclaim { instance_id: Uuid, index: usize },
} }
@ -235,7 +236,10 @@ impl Connection {
Ok(instance_abandon(&mut tx, account, instance_id)?), Ok(instance_abandon(&mut tx, account, instance_id)?),
RpcRequest::VboxAccept { instance_id, group, index } => RpcRequest::VboxAccept { instance_id, group, index } =>
Ok(RpcMessage::InstanceState(vbox_accept(&mut tx, account, instance_id, group, index)?)), Ok(RpcMessage::InstanceState(vbox_accept(&mut tx, account, instance_id, group, index, None)?)),
RpcRequest::VboxAcceptEquip { instance_id, group, index, construct_id } =>
Ok(RpcMessage::InstanceState(vbox_accept(&mut tx, account, instance_id, group, index, Some(construct_id))?)),
RpcRequest::VboxApply { instance_id, construct_id, index } => RpcRequest::VboxApply { instance_id, construct_id, index } =>
Ok(RpcMessage::InstanceState(vbox_apply(&mut tx, account, instance_id, construct_id, index)?)), Ok(RpcMessage::InstanceState(vbox_apply(&mut tx, account, instance_id, construct_id, index)?)),
@ -250,7 +254,10 @@ impl Connection {
Ok(RpcMessage::InstanceState(vbox_reclaim(&mut tx, account, instance_id, index)?)), Ok(RpcMessage::InstanceState(vbox_reclaim(&mut tx, account, instance_id, index)?)),
RpcRequest::VboxUnequip { instance_id, construct_id, target } => RpcRequest::VboxUnequip { instance_id, construct_id, target } =>
Ok(RpcMessage::InstanceState(vbox_unequip(&mut tx, account, instance_id, construct_id, target)?)), Ok(RpcMessage::InstanceState(vbox_unequip(&mut tx, account, instance_id, construct_id, target, None)?)),
RpcRequest::VboxUnequipApply { instance_id, construct_id, target, target_construct_id } =>
Ok(RpcMessage::InstanceState(vbox_unequip(&mut tx, account, instance_id, construct_id, target, Some(target_construct_id))?)),
RpcRequest::MtxConstructSpawn {} => RpcRequest::MtxConstructSpawn {} =>
Ok(RpcMessage::ConstructSpawn(mtx::new_construct(&mut tx, account)?)), Ok(RpcMessage::ConstructSpawn(mtx::new_construct(&mut tx, account)?)),

View File

@ -831,13 +831,13 @@ impl Skill {
// Buff base // Buff base
Skill::HybridBlast => 50, Skill::HybridBlast => 50,
Skill::HasteStrike => 60, Skill::HasteStrike => 60,
Skill::Intercept=> 80, Skill::Intercept=> 80,
Skill::InterceptPlus => 110, Skill::InterceptPlus => 110,
Skill::InterceptPlusPlus => 150, Skill::InterceptPlusPlus => 150,
Skill::TriageTick=> 75, Skill::TriageTick=> 75,
Skill::TriageTickPlus => 110, Skill::TriageTickPlus => 110,
Skill::TriageTickPlusPlus => 140, Skill::TriageTickPlusPlus => 140,
@ -1392,7 +1392,10 @@ fn sustain(source: &mut Construct, target: &mut Construct, mut results: Resoluti
if red > 0 || blue > 0 { EventStages::PostOnly } if red > 0 || blue > 0 { EventStages::PostOnly }
else { EventStages::NoStages } else { EventStages::NoStages }
} }
_ => panic!("not recharge") _ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
}; };
results.push(Resolution::new(source, target).event(e).stages(stages)); results.push(Resolution::new(source, target).event(e).stages(stages));
@ -1411,7 +1414,10 @@ fn intercept(source: &mut Construct, target: &mut Construct, mut results: Resolu
if red > 0 || blue > 0 { EventStages::PostOnly } if red > 0 || blue > 0 { EventStages::PostOnly }
else { EventStages::NoStages } else { EventStages::NoStages }
} }
_ => panic!("not recharge") _ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
}; };
results.push(Resolution::new(source, target).event(e).stages(stages)); results.push(Resolution::new(source, target).event(e).stages(stages));
@ -1713,7 +1719,10 @@ fn reflect(source: &mut Construct, target: &mut Construct, mut results: Resoluti
if red > 0 || blue > 0 { EventStages::PostOnly } if red > 0 || blue > 0 { EventStages::PostOnly }
else { EventStages::NoStages } else { EventStages::NoStages }
} }
_ => panic!("not recharge") _ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
}; };
results.push(Resolution::new(source, target).event(e).stages(stages)); results.push(Resolution::new(source, target).event(e).stages(stages));
return results;; return results;;
@ -1728,7 +1737,10 @@ fn recharge(source: &mut Construct, target: &mut Construct, mut results: Resolut
if red > 0 || blue > 0 { EventStages::AllStages } if red > 0 || blue > 0 { EventStages::AllStages }
else { EventStages::StartEnd } else { EventStages::StartEnd }
} }
_ => panic!("not recharge") _ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
}; };
results.push(Resolution::new(source, target).event(e).stages(stages)); results.push(Resolution::new(source, target).event(e).stages(stages));
return results; return results;

View File

@ -99,8 +99,8 @@ impl Vbox {
self self
} }
pub fn accept(&mut self, i: usize, j: usize) -> Result<&mut Vbox, Error> { pub fn accept(&mut self, i: usize, j: usize, construct_id: Option<Uuid>) -> Result<&mut Vbox, Error> {
if self.bound.len() >= 9 { if self.bound.len() >= 9 && !construct_id.is_some() {
return Err(err_msg("too many items bound")); return Err(err_msg("too many items bound"));
} }
@ -130,7 +130,7 @@ impl Vbox {
pub fn bot_accept(&mut self, i: usize) -> Result<&mut Vbox, Error> { pub fn bot_accept(&mut self, i: usize) -> Result<&mut Vbox, Error> {
let buy_index = self.free[i].iter().position(|item| item.is_some()); let buy_index = self.free[i].iter().position(|item| item.is_some());
self.accept(i, buy_index.expect("no valid buys")) self.accept(i, buy_index.expect("no valid buys"), None)
} }
pub fn reclaim(&mut self, i: usize) -> Result<&mut Vbox, Error> { pub fn reclaim(&mut self, i: usize) -> Result<&mut Vbox, Error> {
@ -181,9 +181,9 @@ pub fn vbox_discard(tx: &mut Transaction, account: &Account, instance_id: Uuid)
return instance_update(tx, instance); return instance_update(tx, instance);
} }
pub fn vbox_accept(tx: &mut Transaction, account: &Account, instance_id: Uuid, group: usize, index: usize) -> Result<Instance, Error> { pub fn vbox_accept(tx: &mut Transaction, account: &Account, instance_id: Uuid, group: usize, index: usize, construct_id: Option<Uuid>) -> Result<Instance, Error> {
let instance = instance_get(tx, instance_id)? let instance = instance_get(tx, instance_id)?
.vbox_accept(account.id, group, index)?; .vbox_accept(account.id, group, index, construct_id)?;
return instance_update(tx, instance); return instance_update(tx, instance);
} }
@ -205,9 +205,9 @@ pub fn vbox_apply(tx: &mut Transaction, account: &Account, instance_id: Uuid, co
return instance_update(tx, instance); return instance_update(tx, instance);
} }
pub fn vbox_unequip(tx: &mut Transaction, account: &Account, instance_id: Uuid, construct_id: Uuid, target: Item) -> Result<Instance, Error> { pub fn vbox_unequip(tx: &mut Transaction, account: &Account, instance_id: Uuid, construct_id: Uuid, target: Item, target_construct_id: Option<Uuid>) -> Result<Instance, Error> {
let instance = instance_get(tx, instance_id)? let instance = instance_get(tx, instance_id)?
.vbox_unequip(account.id, target, construct_id)?; .vbox_unequip(account.id, target, construct_id, target_construct_id)?;
return instance_update(tx, instance); return instance_update(tx, instance);
} }