diff --git a/src/gameClasses/Item.js b/src/gameClasses/Item.js index 011f742b..27165a66 100644 --- a/src/gameClasses/Item.js +++ b/src/gameClasses/Item.js @@ -287,6 +287,7 @@ var Item = IgeEntityPhysics.extend({ if (owner && self._stats.currentBody && self._stats.currentBody.jointType == 'weldJoint') { rotate = owner._rotate.z; } + rotate += self._stats.bulletStartPosition.rotation * Math.PI / 180; if (self.anchoredOffset == undefined) { self.anchoredOffset = { x: 0, y: 0, rotate: 0 }; diff --git a/src/gameClasses/components/script/ActionComponent.js b/src/gameClasses/components/script/ActionComponent.js index 69e93569..da783552 100644 --- a/src/gameClasses/components/script/ActionComponent.js +++ b/src/gameClasses/components/script/ActionComponent.js @@ -1204,7 +1204,27 @@ var ActionComponent = IgeEntity.extend({ item.streamUpdateData([{ fireRate: value }]); } break; + + case 'setItemBulletForce': + var item = ige.variable.getValue(action.item, vars); + var value = ige.variable.getValue(action.number, vars); + + if (item && item._category == 'item') { + item.streamUpdateData([{ bulletForce: value }]); + } + break; + case 'setItemBulletStartPosition': + var item = ige.variable.getValue(action.item, vars); + var rotation = ige.variable.getValue(action.number1, vars); + var x = ige.variable.getValue(action.number2, vars); + var y = ige.variable.getValue(action.number3, vars); + + if (item && item._category == 'item') { + item.streamUpdateData([{ bulletStartPosition: { rotation: rotation, x: x, y: y } }]); + } + break; + case 'changeInventorySlotColor': var item = ige.variable.getValue(action.item, vars); var color = ige.variable.getValue(action.string, vars);